[common] fail-test helpers; failing tests for curry
This commit is contained in:
parent
45092e32f5
commit
2472e3755a
26
private/test-common.rkt
Normal file
26
private/test-common.rkt
Normal 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
13
test/function-fail.rkt
Normal 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)
|
||||
)
|
||||
)
|
Loading…
Reference in New Issue
Block a user