aboutsummaryrefslogtreecommitdiff
path: root/tests/i/text-files/program.cps
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.one>2026-10-16 20:53:52 +0800
committer_ov4 <ov4@ov4.one>2026-10-16 20:53:52 +0800
commit5c00b8cd03cbfc516cce92229f3f4974d7549c24 (patch)
tree9d13c180dc345b3e27d241ac56de2aef99dea739 /tests/i/text-files/program.cps
parent1db81d50e8c664d0707491699485cfb23a0b5907 (diff)
test(compiler): cover fixed CIE behavior and runtime boundaries
Record independently traced outputs with pending human review. Keep standard syntax and naming conflicts as real failures. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat (limited to 'tests/i/text-files/program.cps')
-rw-r--r--tests/i/text-files/program.cps26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/i/text-files/program.cps b/tests/i/text-files/program.cps
new file mode 100644
index 0000000..1d6d5bb
--- /dev/null
+++ b/tests/i/text-files/program.cps
@@ -0,0 +1,26 @@
+DECLARE Line : STRING
+DECLARE Count : INTEGER
+OPENFILE "input.txt" FOR READ
+Count <- 0
+WHILE NOT EOF("input.txt") DO
+ READFILE "input.txt", Line
+ OUTPUT "[", Line, "]"
+ Count <- Count + 1
+ENDWHILE
+CLOSEFILE "input.txt"
+OPENFILE "empty.txt" FOR READ
+OUTPUT EOF("empty.txt"), ":", Count
+CLOSEFILE "empty.txt"
+OPENFILE "result.txt" FOR WRITE
+WRITEFILE "result.txt", "first"
+WRITEFILE "result.txt", ""
+CLOSEFILE "result.txt"
+OPENFILE "result.txt" FOR APPEND
+WRITEFILE "result.txt", "last"
+CLOSEFILE "result.txt"
+OPENFILE "result.txt" FOR READ
+WHILE NOT EOF("result.txt") DO
+ READFILE "result.txt", Line
+ OUTPUT "[", Line, "]"
+ENDWHILE
+CLOSEFILE "result.txt"