aboutsummaryrefslogtreecommitdiff
path: root/tests/ii/files/program.cps
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.one>2026-10-16 20:53:55 +0800
committer_ov4 <ov4@ov4.one>2026-10-16 20:53:55 +0800
commitd19f9ddb866ac2415cbfe66966897a8efe8ddb63 (patch)
tree6be1a9a6e316e776a396813f7cb22c688287b21a /tests/ii/files/program.cps
parent5c00b8cd03cbfc516cce92229f3f4974d7549c24 (diff)
test(compiler): add seeded C++ differential tests across seven groups
Generate 10000 random records per group plus boundary inputs using a portable SHA-256 stream. Compare native and runner output independently. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat (limited to 'tests/ii/files/program.cps')
-rw-r--r--tests/ii/files/program.cps29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/ii/files/program.cps b/tests/ii/files/program.cps
new file mode 100644
index 0000000..9bc4aad
--- /dev/null
+++ b/tests/ii/files/program.cps
@@ -0,0 +1,29 @@
+DECLARE Count : INTEGER
+DECLARE Index : INTEGER
+DECLARE Text : STRING
+DECLARE Extra : STRING
+DECLARE Line : STRING
+DECLARE Combined : STRING
+DECLARE Lines : INTEGER
+INPUT Count
+FOR Index <- 1 TO Count
+ INPUT Text
+ INPUT Extra
+ OPENFILE "roundtrip.txt" FOR WRITE
+ WRITEFILE "roundtrip.txt", Text
+ WRITEFILE "roundtrip.txt", ""
+ CLOSEFILE "roundtrip.txt"
+ OPENFILE "roundtrip.txt" FOR APPEND
+ WRITEFILE "roundtrip.txt", Extra
+ CLOSEFILE "roundtrip.txt"
+ OPENFILE "roundtrip.txt" FOR READ
+ Combined <- ""
+ Lines <- 0
+ WHILE NOT EOF("roundtrip.txt") DO
+ READFILE "roundtrip.txt", Line
+ Combined <- Combined & "[" & Line & "]"
+ Lines <- Lines + 1
+ ENDWHILE
+ CLOSEFILE "roundtrip.txt"
+ OUTPUT Lines, ":", Combined
+NEXT Index