Changeset 16105 in project


Ignore:
Timestamp:
09/28/09 21:54:51 (10 years ago)
Author:
Moritz Heidkamp
Message:

use test instead of test-assert whenever possible

File:
1 edited

Legend:

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

    r16104 r16105  
    3232
    3333  (test-group "with nesting"
    34     (test-assert (equal? "foo" ((uri-match 'post "/foo/bar" (make-routes '(("/foo" ("/bar" (post "foo")))))))))
     34    (test "foo" ((uri-match 'post "/foo/bar" (make-routes '(("/foo" ("/bar" (post "foo"))))))))
    3535
    3636    (test-group "with procedure body"
    37       (test-assert (eq? 'something
    38                         ((uri-match 'get "/me" (make-routes `(("/me" (get ,(lambda () 'something)))))))))
     37      (test 'something
     38            ((uri-match 'get "/me" (make-routes `(("/me" (get ,(lambda () 'something))))))))
    3939
    40       (test-assert (= 100 ((uri-match 'get "/numbers/100"
    41                                       (make-routes `(("/numbers/(\\d+)" (get ,(lambda (n) (string->number n))))))))))))
     40      (test 100 ((uri-match 'get "/numbers/100"
     41                            (make-routes `(("/numbers/(\\d+)" (get ,(lambda (n) (string->number n)))))))))))
    4242
    4343  (test-group "with capture groups"
    4444    (let ([routes (make-routes `(("/foo" ("/(\\d+)" ("/(\\d+)" (get ,string-append))))))])
    4545     
    46       (test-assert (string= "105" ((uri-match 'get "/foo/10/5" routes))))
     46      (test "105" ((uri-match 'get "/foo/10/5" routes)))
    4747      (test-assert (not (uri-match 'get "/foo/bar/10" routes)))))
    4848 
     
    5252                              ((seq "/" (submatch (+ num)))
    5353                               (get ,string-append))))))])
    54       (test-assert (string= "105" ((uri-match 'get "/foo/10/5" routes))))
     54      (test "105" ((uri-match 'get "/foo/10/5" routes)))
    5555      (test-assert (not (uri-match 'get "/foo/bar/10" routes)))))
    5656 
     
    7171  (let ([matcher (make-uri-matcher '(("/" (get "is")) ("/this" (post "it") ("/or" (put "what?")))))])
    7272
    73     (test-assert (equal? "is" ((matcher 'get "/"))))
     73    (test "is" ((matcher 'get "/")))
    7474
    75     (test-assert (equal? "it" ((matcher 'post "/this"))))
     75    (test "it" ((matcher 'post "/this")))
    7676
    77     (test-assert (equal? "what?" ((matcher 'put "/this/or"))))))
     77    (test "what?" ((matcher 'put "/this/or")))))
Note: See TracChangeset for help on using the changeset viewer.