refuse a second input file

It was never read, and nothing said so.
This commit is contained in:
2026-10-19 10:23:59 +03:00
parent 8f4f935478
commit f95b50ef54
2 changed files with 21 additions and 6 deletions

View File

@@ -80,6 +80,18 @@
(and (zero? (car run)) (substring-index "main" (cadr run)) #t)))
(change-directory scratch)
;;; the second was never read, and nothing said so
(test-assert "a second input is refused"
(let ((run (sexc-run #f hello hello "-C" "-o" "-")))
(and (not (zero? (car run)))
(substring-index "one input file at a time" (caddr run))
#t)))
(test-assert "stdin besides a file too"
(let ((run (sexc-run hello-source "-" hello "-C" "-o" "-")))
(and (not (zero? (car run)))
(substring-index "one input file at a time" (caddr run))
#t)))
(test "-o - is refused for an executable" #f
(sexc-succeeds? hello "-o" "-"))