aboutsummaryrefslogtreecommitdiff
path: root/tests/i/strings
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/strings
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/strings')
-rw-r--r--tests/i/strings/case.json3
-rw-r--r--tests/i/strings/expected.txt5
-rw-r--r--tests/i/strings/notes.md7
-rw-r--r--tests/i/strings/program.cps9
4 files changed, 24 insertions, 0 deletions
diff --git a/tests/i/strings/case.json b/tests/i/strings/case.json
new file mode 100644
index 0000000..1f18635
--- /dev/null
+++ b/tests/i/strings/case.json
@@ -0,0 +1,3 @@
+{
+ "exit_code": 0
+}
diff --git a/tests/i/strings/expected.txt b/tests/i/strings/expected.txt
new file mode 100644
index 0000000..54c5a9c
--- /dev/null
+++ b/tests/i/strings/expected.txt
@@ -0,0 +1,5 @@
+0:8
+BCD:FGH
+Summer Pudding
+w:H:@
+TRUE:TRUE
diff --git a/tests/i/strings/notes.md b/tests/i/strings/notes.md
new file mode 100644
index 0000000..e17c08b
--- /dev/null
+++ b/tests/i/strings/notes.md
@@ -0,0 +1,7 @@
+# strings
+
+Human review: pending. Expected output was independently traced by AI, not captured from cpsc.
+
+Basis: CIE pp. 7, 16-17; byte ordering of ASCII strings is a project convention.
+
+Trace: The empty string has length 0; MID positions 2..4 are BCD; the last three characters are FGH. Case conversion changes only the letters. Concatenation creates equal contents.
diff --git a/tests/i/strings/program.cps b/tests/i/strings/program.cps
new file mode 100644
index 0000000..e1f934b
--- /dev/null
+++ b/tests/i/strings/program.cps
@@ -0,0 +1,9 @@
+DECLARE Empty : STRING
+DECLARE Text : STRING
+Empty <- ""
+Text <- "ABCDEFGH"
+OUTPUT LENGTH(Empty), ":", LENGTH(Text)
+OUTPUT MID(Text, 2, 3), ":", RIGHT(Text, 3)
+OUTPUT "Summer" & " " & "Pudding"
+OUTPUT LCASE('W'), ":", UCASE('h'), ":", LCASE('@')
+OUTPUT "same" = ("sa" & "me"), ":", "A" < "B"