another *SL error-rewriting fix

Arity errors no include supplied arguments, but strip them
away for *SL messages.
This commit is contained in:
Matthew Flatt 2012-06-06 12:25:14 +08:00
parent 269a3392dc
commit 255e3cbe2e
2 changed files with 5 additions and 2 deletions

View File

@ -115,11 +115,11 @@
(lambda (all one two) (format "expects a ~a" two))) (lambda (all one two) (format "expects a ~a" two)))
(list #rx"expects type (<([^>]+)>)" (list #rx"expects type (<([^>]+)>)"
(lambda (all one two) (format "expects a ~a" two))) (lambda (all one two) (format "expects a ~a" two)))
(list #px"application: wrong number of arguments.*\n procedure: ([^\n]*)\n expected[^:]*: at least (\\d+)\n given[^:]*: (\\d+)" (list #px"application: wrong number of arguments.*\n procedure: ([^\n]*)\n expected[^:]*: at least (\\d+)\n given[^:]*: (\\d+)(?:\n arguments:(?:\n [^\n]*)*)?"
(lambda (all one two three) (argcount-error-message one two three #t))) (lambda (all one two three) (argcount-error-message one two three #t)))
(list #px"application: wrong number of arguments.*\n procedure: ([^\n]*)\n expected[^:]*: (\\d+)\n given[^:]*: (\\d+)(?:\n arguments:(?:\n [^\n]*)*)?" (list #px"application: wrong number of arguments.*\n procedure: ([^\n]*)\n expected[^:]*: (\\d+)\n given[^:]*: (\\d+)(?:\n arguments:(?:\n [^\n]*)*)?"
(lambda (all one two three) (argcount-error-message one two three))) (lambda (all one two three) (argcount-error-message one two three)))
(list #px"contract violation\n expected: (.*?)\n given: ([^\n]*)(?:\n argument position: ([^\n]*))?(?:\n other arguments:.*)?" (list #px"contract violation\n expected: (.*?)\n given: ([^\n]*)(?:\n argument position: ([^\n]*))?"
(lambda (all ctc given pos) (contract-error-message ctc given pos))) (lambda (all ctc given pos) (contract-error-message ctc given pos)))
(list #rx"^procedure " (list #rx"^procedure "
(lambda (all) "")) (lambda (all) ""))
@ -127,6 +127,8 @@
(lambda (all) ", given ")) (lambda (all) ", given "))
(list #rx"; other arguments were:.*" (list #rx"; other arguments were:.*"
(lambda (all) "")) (lambda (all) ""))
(list #px"(?:\n other arguments:(?:\n [^\n]*)*)"
(lambda (all) ""))
(list #rx"expects a (struct:)" (list #rx"expects a (struct:)"
(lambda (all one) "expects a ")) (lambda (all one) "expects a "))
(list #rx"list or cyclic list" (list #rx"list or cyclic list"

View File

@ -1,5 +1,6 @@
(htdp-err/rt-test (/) "/: expects at least 2 arguments, but found none") (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-syntax-test #'(local [(define x 5)] x) "local: this function is not defined") (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") (htdp-syntax-test #'(recur name ([x 18]) x) "recur: this function is not defined")