diff --git a/pkgs/racket-test-core/tests/racket/function.rktl b/pkgs/racket-test-core/tests/racket/function.rktl index 42d14d91c8..36b62177ab 100644 --- a/pkgs/racket-test-core/tests/racket/function.rktl +++ b/pkgs/racket-test-core/tests/racket/function.rktl @@ -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) diff --git a/pkgs/racket-test-core/tests/racket/procs.rktl b/pkgs/racket-test-core/tests/racket/procs.rktl index 25f0a3735c..3b804af04a 100644 --- a/pkgs/racket-test-core/tests/racket/procs.rktl +++ b/pkgs/racket-test-core/tests/racket/procs.rktl @@ -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