Avoid duplicating code in test files.
This commit is contained in:
parent
31fbce7e5a
commit
62fc516c24
|
@ -25,5 +25,5 @@
|
|||
|
||||
(module+ main
|
||||
(tcp-localhost-available?))
|
||||
(module+ test
|
||||
(tcp-localhost-available?))
|
||||
|
||||
(module+ test (require (submod ".." main))) ; for raco test & drdr
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
|
||||
(provide tests)
|
||||
(module+ main (tests))
|
||||
(module+ test (tests))
|
||||
(define (tests)
|
||||
(putenv "REQUEST_METHOD" "GET")
|
||||
(test (test-bindings 'amp-or-semi "key1=value1&key2=value2;key3=value3")
|
||||
|
@ -22,3 +21,5 @@
|
|||
=> '([key1 . "value1"] [key2 . "value2"])
|
||||
(test-bindings 'semi "key1=value1&key2=value2")
|
||||
=> '([key1 . "value1&key2=value2"])))
|
||||
|
||||
(module+ test (require (submod ".." main))) ; for raco test & drdr
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
(provide tests)
|
||||
(module+ main (tests))
|
||||
(module+ test (tests))
|
||||
(define (tests)
|
||||
;; cookie-test : (cookie -> cookie) string -> test
|
||||
(define (cookie-test fn expected)
|
||||
|
@ -97,3 +96,5 @@
|
|||
)
|
||||
|
||||
(test do (tests)))
|
||||
|
||||
(module+ test (require (submod ".." main))) ; for raco test & drdr
|
||||
|
|
|
@ -99,9 +99,10 @@
|
|||
|
||||
(provide tests)
|
||||
(module+ main (tests))
|
||||
(module+ test (tests))
|
||||
(define (tests)
|
||||
(test do (internal-tests)
|
||||
(nameserver-tests *google-dns*)
|
||||
(nameserver-tests *google-dns-2*)
|
||||
(let ([ns (dns-find-nameserver)]) (when ns (nameserver-tests ns)))))
|
||||
|
||||
(module+ test (require (submod ".." main))) ; for raco test & drdr
|
||||
|
|
|
@ -70,7 +70,6 @@
|
|||
|
||||
(provide tests)
|
||||
(module+ main (tests))
|
||||
(module+ test (tests))
|
||||
(define (tests)
|
||||
(test
|
||||
do (check-same-all (lambda (i o) (qp-encode-stream i o))
|
||||
|
@ -109,3 +108,5 @@ Use this to compare base64 encode/decode against the unix utilities
|
|||
(and (equal? en (base64-encode* bstr))
|
||||
(equal? (base64-decode en) (base64-decode* en)))))
|
||||
|#
|
||||
|
||||
(module+ test (require (submod ".." main))) ; for raco test & drdr
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
|
||||
(provide tests)
|
||||
(module+ main (tests))
|
||||
(module+ test (tests))
|
||||
(define (tests)
|
||||
(define cop (open-output-string))
|
||||
(define-values [pasv1-thd pasv1-port] (tcp-serve* (current-output-port) DIRLIST))
|
||||
|
@ -280,3 +279,5 @@
|
|||
RNTO test2
|
||||
QUIT
|
||||
@||})
|
||||
|
||||
(module+ test (require (submod ".." main))) ; for raco test & drdr
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
(provide tests)
|
||||
(module+ main (tests))
|
||||
(module+ test (tests))
|
||||
(define (tests)
|
||||
(define test-header
|
||||
(string-append "From: abc\r\nTo: field is\r\n continued\r\n"
|
||||
|
@ -93,3 +92,5 @@
|
|||
=> #"From: abc\r\nTo: field is\r\n continued\r\nAnother: zoo\r\n continued\r\nAthird: data\r\n\r\n"
|
||||
|
||||
))
|
||||
|
||||
(module+ test (require (submod ".." main))) ; for raco test & drdr
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
|
||||
(provide tests)
|
||||
(module+ main (tests))
|
||||
(module+ test (tests))
|
||||
(define (tests)
|
||||
(test
|
||||
;; ----------------------------------------
|
||||
|
@ -124,3 +123,5 @@
|
|||
(not ((bytes-of-length 5) "moogle"))
|
||||
;; ----------------------------------------
|
||||
))
|
||||
|
||||
(module+ test (require (submod ".." main))) ; for raco test & drdr
|
||||
|
|
|
@ -35,7 +35,6 @@ EOS
|
|||
|
||||
(provide tests)
|
||||
(module+ main (tests))
|
||||
(module+ test (tests))
|
||||
(define (tests)
|
||||
(define analyzed (mime-analyze ip))
|
||||
(define our-entity (message-entity analyzed))
|
||||
|
@ -60,3 +59,5 @@ EOS
|
|||
(open-input-string "Content-Type: multipart/mixed\r\n\r\n"))
|
||||
=error> missing-multipart-boundary-parameter?
|
||||
))
|
||||
|
||||
(module+ test (require (submod ".." main))) ; for raco test & drdr
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
(provide tests)
|
||||
(module+ main (tests))
|
||||
(module+ test (tests))
|
||||
(define (tests)
|
||||
(define sepmode current-alist-separator-mode)
|
||||
(test (uri-decode "%Pq") => "%Pq"
|
||||
|
@ -147,3 +146,5 @@
|
|||
=> '([key1 . "value 1"] [key2 . "value 2"])
|
||||
|
||||
))
|
||||
|
||||
(module+ test (require (submod ".." main))) ; for raco test & drdr
|
||||
|
|
|
@ -123,7 +123,6 @@
|
|||
|
||||
(provide tests)
|
||||
(module+ main (tests))
|
||||
(module+ test (tests))
|
||||
(define (tests)
|
||||
(test
|
||||
(run-tests "http" values #f)
|
||||
|
@ -133,3 +132,5 @@
|
|||
(lambda (in out)
|
||||
(ports->ssl-ports in out #:mode 'accept #:context ctx)))
|
||||
#t)))
|
||||
|
||||
(module+ test (require (submod ".." main))) ; for raco test & drdr
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
|
||||
(provide tests)
|
||||
(module+ main (test do (tests)))
|
||||
(module+ test (test do (tests)))
|
||||
(define (tests)
|
||||
(test
|
||||
;; Test the current-proxy-servers parameter can be set
|
||||
|
@ -379,3 +378,5 @@
|
|||
))
|
||||
|
||||
)
|
||||
|
||||
(module+ test (require (submod ".." main))) ; for raco test & drdr
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
|
||||
(provide tests)
|
||||
(module+ main (tests))
|
||||
(module+ test (tests))
|
||||
(define (tests)
|
||||
(test
|
||||
(for ([i (in-range RANDOM-K)])
|
||||
|
@ -94,3 +93,5 @@
|
|||
(parameterize ([framing-mode 'old]) (test-echo-server))
|
||||
#:failure-prefix "new"
|
||||
(parameterize ([framing-mode 'new]) (test-echo-server)))))))
|
||||
|
||||
(module+ test (require (submod ".." main))) ; for raco test & drdr
|
||||
|
|
Loading…
Reference in New Issue
Block a user