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


Ignore:
Timestamp:
11/27/08 20:56:03 (12 years ago)
Author:
sjamaan
Message:

Fix bugs in normalize-case and add regression tests for it

File:
1 edited

Legend:

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

    r12582 r12614  
    180180                  (test (sprintf "~S * ~S -> ~S" (first p) (second p) (third p)) expected updated)))
    181181            update-cases))
     182
     183(define normalize-case-cases
     184  '(("http://exa%2fmple/FOO%2fbar" "http://exa%2Fmple/FOO%2Fbar")
     185    ("http://EXA%2fMPLE/FOO%2fbar" "http://exa%2Fmple/FOO%2Fbar")
     186    ("HTTP://example/" "http://example/")
     187    ("http://user:PASS@example/FOO%2fbar" "http://user:PASS@example/FOO%2Fbar")
     188    ("http://uS%2fer:PA%2fSS@example/FOO%2fbar" "http://uS%2Fer:PA%2FSS@example/FOO%2Fbar")
     189    ("HTTP://example/?mooH=MUMBLe%2f" "http://example/?mooH=MUMBLe%2F")
     190    ("http://example/#baR%2f" "http://example/#baR%2F")))
     191
     192(test-group "normalize-case test"
     193  (for-each (lambda (p)
     194              (let ((case-normalized (uri-normalize-case (uri-reference (first p))))
     195                    (expected (second p)))
     196                  (test (sprintf "~S -> ~S" (first p) (second p)) expected (uri->string case-normalized (lambda (user pass) (conc user ":" pass))))))
     197            normalize-case-cases))
Note: See TracChangeset for help on using the changeset viewer.