Skip to content

Commit

Permalink
test,url: add some url/literal tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogdanp committed Oct 30, 2024
1 parent ef7c302 commit f3f9da6
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions http-easy-test/net/http-easy/private/url.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,22 @@
[e (in-value (cdr pair))])
(check-equal? (url->string (string->url* s)) e s))))

(test-suite
"url/literal"

(test-case "roundtrips"
(define tests
'(("http://example.com" . "http://example.com")
("http://[email protected]:5100" . "http://[email protected]:5100")
("http://example.com/a/b/c" . "http://example.com/a/b/c")
("http://example.com/a%2Bb.mp3" . "http://example.com/a%2Bb.mp3")
("http://example.com/a%2Bb.mp3?c=d+e" . "http://example.com/a%2Bb.mp3?c=d%2Be")))

(for* ([pair (in-list tests)]
[s (in-value (car pair))]
[e (in-value (cdr pair))])
(check-equal? (url/literal->string (string->url/literal s)) e s))))

(test-suite
"is-percent-encoded?"

Expand Down

0 comments on commit f3f9da6

Please sign in to comment.