Changeset 12827 in project for release/4/uri-generic/trunk/tests


Ignore:
Timestamp:
12/15/08 22:39:27 (12 years ago)
Author:
sjamaan
Message:

Change representation of paths to be just the segment contents, not the segments including slashes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/uri-generic/trunk/tests/run.scm

    r12810 r12827  
    7979  `((,base "" ,base)
    8080    (,base "../../../g" "http://a/g")
    81     (,base "../../../../g" "http://a/g")
     81    (,base "../../../../g" "http://a/g")
     82    (,base "../../../.." "http://a/") ; Is this correct? Or http://a ?
     83    (,base "../../../../" "http://a/")
    8284    (,base "/./g" "http://a/g")
    8385    (,base "/../g" "http://a/g")
     
    108110    ))
    109111
     112(define reverse-extra-cases
     113  `((,base ,base "")
     114    (,base "http://a/b/c/e" "./e")
     115    (,base "http://a/b/e" "../e")
     116    (,base "http://a/" "/") ;; or "../../"
     117    (,base "http://a" "//a") ; No relative representation possible
     118    (,base "http://b" "//b")
     119    (,base "http://b/" "//b/")
     120    (,base "http://b/c" "//b/c")
     121    (,base "ftp://a/b/c/d;p?q" "ftp://a/b/c/d;p?q")
     122    (,base "ftp://x/y/z;a?b" "ftp://x/y/z;a?b")))
     123
    110124(test-group "uri test"
    111125  (for-each (lambda (p)
     
    153167            extra-cases))
    154168
     169(test-group "reverse-extra-test"
     170  (for-each (lambda (p)
     171              (let ((ubase (uri-reference (first p)))
     172                    (urabs  (uri-reference (second p)))
     173                    (uex   (uri-reference (third p))))
     174                (let* ((to    (uri-relative-from urabs ubase)))
     175                  (test (apply sprintf "~S * ~S -> ~S" p) uex to)
     176                  )))
     177            reverse-extra-cases))
     178
    155179(define encode/decode-cases
    156180  '(("foo?bar" "foo%3fbar")
     
    173197
    174198(define update-cases
    175   '(("/foo" (path: ("/bar")) "/bar")
     199  '(("/foo" (path: (/ "bar")) "/bar")
     200    ("/foo" (path: ("bar")) "bar")
    176201    ("/foo" (host: "localhost") "//localhost/foo")
    177202    ("http://foo" (query: "a=b&c&d?=%2fe") "http://foo?a=b&c&d?=%2fe")
Note: See TracChangeset for help on using the changeset viewer.