aboutsummaryrefslogtreecommitdiff
path: root/tests/i/stdin
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-22 15:33:17 +0000
committer_ov4 <ov4@ov4.org>2026-10-22 15:35:05 +0000
commit8745f421b4cf7e1d54c17a360d46fab889ca12cc (patch)
tree4c2a3508627db04493af35643580417d41b63f89 /tests/i/stdin
parent5e84edbe1a79c6a7752ee276ea6c1a4daef4fa8e (diff)
feat(input)!: validate INPUT and read whole lines into STRING
Scalar INPUT now reads one whitespace-delimited token through module-local IR helpers instead of scanf, then skips spaces and tabs and consumes one newline. INTEGER, REAL, BOOLEAN (TRUE or FALSE in any case) and CHAR are validated, and bad input or end of input is a runtime error. STRING INPUT reads the rest of the line. The unused scanf and REAL printf format globals are removed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests/i/stdin')
-rw-r--r--tests/i/stdin/input.txt2
-rw-r--r--tests/i/stdin/notes.md2
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/i/stdin/input.txt b/tests/i/stdin/input.txt
index 604b657..4ac051f 100644
--- a/tests/i/stdin/input.txt
+++ b/tests/i/stdin/input.txt
@@ -1,4 +1,4 @@
-7
-1
+TRUE
Z
hello
diff --git a/tests/i/stdin/notes.md b/tests/i/stdin/notes.md
index 62f8727..63f1a22 100644
--- a/tests/i/stdin/notes.md
+++ b/tests/i/stdin/notes.md
@@ -2,4 +2,4 @@
Human review: pending. Expected output was independently traced by AI, not captured from cpsc.
-Basis and trace: CIE p. 15; the project INPUT contract reads BOOLEAN as an integer (nonzero is true) and STRING as a whitespace-delimited token.
+Basis and trace: CIE p. 15; the project INPUT contract reads BOOLEAN as TRUE or FALSE in any case, other scalars as whitespace-delimited tokens, and STRING as the rest of the line.