source: project/url/url-test.scm @ 4087

Last change on this file since 4087 was 4087, checked in by Kon Lovett, 13 years ago

Added test.

File size: 1016 bytes
Line 
1;;;; url-test.scm
2
3(use testbase testbase-output-human)
4(use url)
5
6#| TestBase
7  (test
8    (purpose "Checkout url build.")
9    (feature url)
10    (reader-extension uri))
11
12  (compile
13    (extend (use uri)))
14|#
15
16;;;
17
18(define-test url-test "URL"
19  (initial
20    (define turl #f)
21  )
22
23  (expect-set! turl (url "http://www.ics.uci.edu:80"))
24  (expect-false "Null path" (url-path turl))
25
26  (expect-set! turl
27    (make-url #:scheme "http" #:host "www.ics.uci.edu" #:port 80 #:path "pub/ietf/uri"))
28  (expect-true (url? turl))
29  (expect-equal "http://www.ics.uci.edu:80/pub/ietf/uri" (url->string turl))
30
31  (expect-set! turl (url "http://www.ics.uci.edu:80/pub/ietf/uri;type=i"))
32  (expect-true (url? turl))
33
34  (expect-equal (warn "Suffix '/' in output was not part of the input!")
35    "http://www.ics.uci.edu:80/pub/ietf/uri/;type=i"
36    (url->string (url "http://www.ics.uci.edu:80/pub/ietf/uri;type=i")))
37  (expect-eq #\i (url-typecode turl))
38)
39
40(test::styler-set! url-test test::output-style-human)
41(run-test "URL Tests")
Note: See TracBrowser for help on using the repository browser.