diff --git a/collects/lang/private/teachhelp.rkt b/collects/lang/private/teachhelp.rkt index bf5b7696c4..0e6da1f0af 100644 --- a/collects/lang/private/teachhelp.rkt +++ b/collects/lang/private/teachhelp.rkt @@ -65,7 +65,7 @@ (unless (= found arity) (raise-syntax-error #f - (argcount-error-message arity found) + (argcount-error-message #f arity found) stx #f)) (datum->syntax-object diff --git a/collects/tests/htdp-lang/beg-bega.rktl b/collects/tests/htdp-lang/beg-bega.rktl index 5fb1cd41d5..4ac713c90c 100644 --- a/collects/tests/htdp-lang/beg-bega.rktl +++ b/collects/tests/htdp-lang/beg-bega.rktl @@ -2,6 +2,10 @@ (htdp-err/rt-test (/) "/: expects at least 2 arguments, but found none") (htdp-err/rt-test (+ 1) #rx"^[+]: expects at least 2 arguments, but found only 1$") +(htdp-top (define (f x) x)) +(htdp-syntax-test #'(f 1 2) "f: expects only 1 argument, but found 2") +(htdp-top-pop 1) + (htdp-syntax-test #'(local [(define x 5)] x) "local: this function is not defined") (htdp-syntax-test #'(recur name ([x 18]) x) "recur: this function is not defined") diff --git a/collects/tests/htdp-lang/intm-adv.rktl b/collects/tests/htdp-lang/intm-adv.rktl index 24ea1e2708..370903ad29 100644 --- a/collects/tests/htdp-lang/intm-adv.rktl +++ b/collects/tests/htdp-lang/intm-adv.rktl @@ -3,6 +3,10 @@ (htdp-err/rt-test (pi) #px"function call: expected a function after the open parenthesis, but received 3[.]14\\d+$") (htdp-err/rt-test (pi 1 2) #px"function call: expected a function after the open parenthesis, but received 3[.]14\\d+\n arguments:\n 1\n 2$") +(htdp-top (define (f x) x)) +(htdp-err/rt-test (f 1 2) "f: expects only 1 argument, but found 2") +(htdp-top-pop 1) + ;; These are true for beginner, but the operators are syntax, so ;; arity-test doesn't work.