print an error as its message alone
Every error ended in CHICKEN's call history, which is for working on sexc itself, and is now asked for by SEXC_DEBUG; a missing input file says so, rather than as an open-input-file error of CHICKEN's.
This commit is contained in:
@@ -105,6 +105,25 @@
|
||||
(test "and the source is as it was" hello-source
|
||||
(call-with-input-file "victim.sex" (lambda (p) (read-string #f p))))
|
||||
|
||||
;;; An error is its message: CHICKEN's call history after it is for
|
||||
;;; working on sexc itself, and asked for by SEXC_DEBUG
|
||||
(test-assert "a missing input says so"
|
||||
(let ((run (sexc-run #f "no-such.sex")))
|
||||
(and (not (zero? (car run)))
|
||||
(substring-index "no-such.sex: no such file" (caddr run))
|
||||
(not (substring-index "Call history" (caddr run))))))
|
||||
(test-assert "and any error is its message alone"
|
||||
(let ((run (sexc-run "(fn f () int (return \"\\q\"))" "-C" "-o" "-")))
|
||||
(and (= 70 (car run))
|
||||
(substring-index "Error: stdin:1: unknown escape" (caddr run))
|
||||
(not (substring-index "Call history" (caddr run))))))
|
||||
(test-assert "unless the history is asked for"
|
||||
(begin
|
||||
(set-environment-variable! "SEXC_DEBUG" "1")
|
||||
(let ((run (sexc-run "(fn f () int (return \"\\q\"))" "-C" "-o" "-")))
|
||||
(unset-environment-variable! "SEXC_DEBUG")
|
||||
(and (substring-index "Call history" (caddr run)) #t))))
|
||||
|
||||
(delete-directory scratch #t)
|
||||
|
||||
(test-exit)
|
||||
|
||||
Reference in New Issue
Block a user