add extra tests related to procedure-reduce-arity

Related to #2746, but repair was at the Chez Scheme level,
fixing a (currently) Racket-specific patch there.
This commit is contained in:
Matthew Flatt 2019-07-17 17:05:15 -06:00
parent c397dba145
commit 4d361187a2
2 changed files with 18 additions and 1 deletions

View File

@ -265,4 +265,18 @@
(((curryr list 1) 2 3) . => . '(2 3 1))
)
;; Regression test for arity checking and a large number of arguments
;; (thanks to James Bornholt)
(let ()
(define extreme
(case-lambda
[(op x) x]
[(op x y) (if (op x y) x y)]
[(op x y . z) (apply extreme op (extreme op x y) z)]))
(define @max (curry extreme >=))
(define l (for/list ([i 100]) 0))
(test 0 apply @max l))
(report-errs)

View File

@ -254,7 +254,10 @@
[(equal? allowed '(#:a #:b))
(err/rt-test ((car p) 1 #:a 1 #:b 1))]
[(equal? allowed #f)
(err/rt-test ((car p) 1 #:a 1 #:b 1))])))))))
(err/rt-test ((car p) 1 #:a 1 #:b 1))])))
;; Try supplying many arguments
(when (procedure-arity-includes? (car p) 100)
(test #t list? (apply (car p) (for/list ([i 100]) i))))))))
(map
add-chaperone
(append procs