[test] redirect function=fail output, to hide it

This commit is contained in:
ben 2016-03-19 23:38:07 -04:00
parent 82cee4b93a
commit 5cdcba0a5c

View File

@ -1,23 +1,27 @@
#lang racket/base #lang racket/base
(require trivial/private/test-common) (require
trivial/private/test-common
(only-in racket/port open-output-nowhere))
(module+ test (test-compile-error (module+ test
#:require trivial/function trivial/format (parameterize ([current-error-port (open-output-nowhere)]) ;; TODO
#:exn #rx"Type Checker|lambda:|λ:" ;; TODO, bummer to include lambda: (test-compile-error
((curry: (lambda (x y) x)) 0 1) #:require trivial/function trivial/format
(((curry: (lambda (x y z) z)) 'x) 'y 'z) #:exn exn? ;#rx"Type Checker"
(((curry: (lambda ([x : Integer] [y : Integer]) (+ x x y))) 'a) 'b) ((curry: (lambda (x y) x)) 0 1)
((((curry: (λ ([x : Any] [y : Any]) x)) 'a) 'b) 'c) (((curry: (lambda (x y z) z)) 'x) 'y 'z)
(map: (λ ([x : String] [y : String]) (((curry: (lambda ([x : Integer] [y : Integer]) (+ x x y))) 'a) 'b)
((((curry: (λ ([x : Any] [y : Any]) x)) 'a) 'b) 'c)
(map: (λ ([x : String] [y : String])
(string-append x y))
'("hello"))
(map: (λ ([x : String] [y : String])
(string-append x y)) (string-append x y))
'("hello")) '("hello")
(map: (λ ([x : String] [y : String]) '("world")
(string-append x y)) '("howareya"))
'("hello") (map: (λ ([x : String] [y : String])
'("world") (format: "~d ~d" x y))
'("howareya")) '("hello")
(map: (λ ([x : String] [y : String]) '("world"))
(format: "~d ~d" x y)) )))
'("hello")
'("world"))
))