[common] fail-test helpers; failing tests for curry

This commit is contained in:
ben 2016-03-04 18:16:25 -05:00
parent 45092e32f5
commit 2472e3755a
2 changed files with 39 additions and 0 deletions

26
private/test-common.rkt Normal file
View File

@ -0,0 +1,26 @@
#lang racket/base
(provide
test-compile-error
)
(require
rackunit
(for-syntax
racket/base
syntax/parse))
;; =============================================================================
(define-syntax (test-compile-error stx)
(syntax-parse stx
[(_ #:require r-s* ...
#:exn exn-rx
e* ...)
(syntax/loc stx
(begin
(check-exn exn-rx
(lambda ()
(compile-syntax #'(module t typed/racket/base (require r-s* ...) e*))))
...))]))

13
test/function-fail.rkt Normal file
View File

@ -0,0 +1,13 @@
#lang racket/base
(require trivial/private/test-common)
(module+ test
(test-compile-error
#:require trivial/function
#:exn #rx"Type Checker"
;; ---
((curry: (lambda (x y) x)) 0 1)
(((curry: (lambda (x y z) z)) 'x) 'y 'z)
)
)