Ignore:
Timestamp:
10/12/08 22:47:40 (12 years ago)
Author:
sjamaan
Message:

Fix uri-encode-string, add testcases for uri-encode-string and uri-decode-string

File:
1 edited

Legend:

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

    r11827 r12139  
    136136                  )))
    137137            extra-cases))
     138
     139(define encode/decode-cases
     140  '(("foo?bar" "foo%3fbar")
     141    ("foo&bar" "foo%26bar")
     142    ("foo%20bar" "foo%2520bar")))
     143
     144(test-group "uri-encode-string test"
     145  (for-each (lambda (p)
     146              (let ((expected (second p))
     147                    (encoded (uri-encode-string (first p))))
     148                  (test (sprintf "~S -> ~S" (first p) expected) expected encoded)))
     149            encode/decode-cases))
     150
     151(test-group "uri-decode-string test"
     152  (for-each (lambda (p)
     153              (let ((expected (first p))
     154                    (decoded (uri-decode-string (second p))))
     155                  (test (sprintf "~S -> ~S" (second p) expected) expected decoded)))
     156            encode/decode-cases))
Note: See TracChangeset for help on using the changeset viewer.