/[de-setf-amqp]/test/amqp-uri.lisp
ViewVC logotype

Contents of /test/amqp-uri.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3 - (show annotations)
Tue Feb 23 09:05:39 2010 UTC (4 years, 1 month ago) by janderson
File size: 2412 byte(s)
Merge commit 'remotes/github/master' into remotes/git-svn
1 ;;; -*- Package: de.setf.amqp.implementation; -*-
2
3 (in-package :de.setf.amqp.implementation)
4
5 (document :file
6 (description "This file defines tests for the amqp-uri class of the 'de.setf.amqp' library.")
7 (copyright
8 "Copyright 2010 [james anderson](mailto:james.anderson@setf.de)"
9 "'de.setf.amqp' is free software: you can redistribute it and/or modify it under the terms of version 3
10 of the GNU Affero General Public License as published by the Free Software Foundation.
11
12 'setf.amqp' is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
13 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 See the Affero General Public License for more details.
15
16 You should have received a copy of the GNU Affero General Public License along with 'de.setf.amqp'.
17 If not, see the GNU [site](http://www.gnu.org/licenses/)."))
18
19
20 (test:test amqp/amqp-uri
21 (flet ((eqv (l1 l2) (and (null (set-difference l1 l2 :test 'equal)) (null (set-difference l2 l1 :test 'equal)))))
22
23 (and (eqv (make-load-form (merge-uris (uri "/asdf/qwer.txt") (uri "amqp://test.com:23/xxx/yyy.zzz")))
24 '(make-instance 'uri :scheme :amqp :host "test.com" :port 23 :path '"/asdf/qwer.txt" :query nil :fragment nil :plist 'nil :string nil :parsed-path '(:absolute "asdf" "qwer.txt")))
25 (eqv (make-load-form (merge-uris (uri "qwer.txt") #u"amqp://test.com:23/asdf/qwer/xxx.yyy"))
26 '(MAKE-INSTANCE 'URI :SCHEME :AMQP :HOST "test.com" :PORT 23 :PATH '"/asdf/qwer/qwer.txt" :QUERY NIL :FRAGMENT NIL :PLIST 'NIL :STRING NIL :PARSED-PATH 'NIL))
27 (eqv (make-load-form (merge-uris (uri "./qwer.txt") (uri "amqp://test.com:23/asdf/qwer/xxx.yyy")))
28 '(MAKE-INSTANCE 'URI :SCHEME :AMQP :HOST "test.com" :PORT 23 :PATH '"/asdf/qwer/qwer.txt" :QUERY NIL :FRAGMENT NIL :PLIST 'NIL :STRING NIL :PARSED-PATH 'NIL))
29 (eqv (make-load-form (merge-uris (uri "../qwer.txt") (uri "amqp://test.com:23/asdf/qwer/xxx.yyy")))
30 '(MAKE-INSTANCE 'URI :SCHEME :AMQP :HOST "test.com" :PORT 23 :PATH '"/asdf/qwer.txt" :QUERY NIL :FRAGMENT NIL :PLIST 'NIL :STRING NIL :PARSED-PATH 'NIL))
31
32 (eqv (uri-query-plist (uri "amqp://test.com:23/xxx/yyy.zzz?exchange=e1&queue=q1"))
33 '(:EXCHANGE "e1" :QUEUE "q1"))
34 (equal "e1" (uri-exchange (uri "amqp://test.com:23/xxx/yyy.zzz?exchange=e1&queue=q1"))))))

  ViewVC Help
Powered by ViewVC 1.1.5