diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-20 13:07:03 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-20 13:07:03 +0000 |
| commit | c682f983b0dce3acba76d1f08719a26b9c52c5ec (patch) | |
| tree | 88b1e2f236bb496fe0966f7daec5879add27b747 /tests | |
| parent | 8f532e4ad72e82acc9135ffd24ecd923bc6d23ee (diff) | |
test(strings): align error cases with the standard library
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/iii/diagnostic-nested-call/case.json | 2 | ||||
| -rw-r--r-- | tests/iii/diagnostic-nested-call/notes.md | 2 | ||||
| -rw-r--r-- | tests/iii/operator-global-errors/notes.md | 2 | ||||
| -rw-r--r-- | tests/iii/operator-global-errors/program.cps | 2 | ||||
| -rw-r--r-- | tests/iii/overload-errors/case.json | 2 | ||||
| -rw-r--r-- | tests/iii/overload-errors/program.cps | 2 |
6 files changed, 6 insertions, 6 deletions
diff --git a/tests/iii/diagnostic-nested-call/case.json b/tests/iii/diagnostic-nested-call/case.json index a00f88b..5bccd92 100644 --- a/tests/iii/diagnostic-nested-call/case.json +++ b/tests/iii/diagnostic-nested-call/case.json @@ -1,7 +1,7 @@ { "errors": [ { - "reason": "MID\\ expects\\ 3\\ args", + "reason": "Incorrect # arguments passed to MID", "line": 2 } ] diff --git a/tests/iii/diagnostic-nested-call/notes.md b/tests/iii/diagnostic-nested-call/notes.md index 252dec7..548a7e0 100644 --- a/tests/iii/diagnostic-nested-call/notes.md +++ b/tests/iii/diagnostic-nested-call/notes.md @@ -1,3 +1,3 @@ # diagnostic-nested-call -The compiler must reject this program: MID expects 3 args. The diagnostic must identify line 2; compilation must preserve existing output. +The compiler must reject this program: the standard-library MID function expects 3 arguments. The diagnostic must report the incorrect argument count on line 2; compilation must preserve existing output. diff --git a/tests/iii/operator-global-errors/notes.md b/tests/iii/operator-global-errors/notes.md index 24bb113..ef5c9c2 100644 --- a/tests/iii/operator-global-errors/notes.md +++ b/tests/iii/operator-global-errors/notes.md @@ -1,3 +1,3 @@ # operator-global-errors -Reject a STRING comparison result assigned to BOOLEAN, implicit INTEGER-to-REAL overload matching, builtin-only overloads, wrong arity and return-type-only duplicates. +Reject a STRING comparison result assigned to BOOLEAN, implicit INTEGER-to-REAL overload matching, operator overloads with only INTEGER operands, wrong arity and return-type-only duplicates. STRING is a class and can participate in operator overloads, so the invalid declaration uses INTEGER for both operands. diff --git a/tests/iii/operator-global-errors/program.cps b/tests/iii/operator-global-errors/program.cps index 23bfae1..b9d007a 100644 --- a/tests/iii/operator-global-errors/program.cps +++ b/tests/iii/operator-global-errors/program.cps @@ -11,7 +11,7 @@ DECLARE a : Box DECLARE flag : BOOLEAN flag <- a < a OUTPUT a + 1 -OVERLOAD FUNCTION OPERATOR&(a : INTEGER, b : STRING) RETURNS STRING +OVERLOAD FUNCTION OPERATOR&(a : INTEGER, b : INTEGER) RETURNS INTEGER RETURN b ENDFUNCTION OVERLOAD FUNCTION OPERATOR*(a : Box) RETURNS INTEGER diff --git a/tests/iii/overload-errors/case.json b/tests/iii/overload-errors/case.json index b31c666..f720889 100644 --- a/tests/iii/overload-errors/case.json +++ b/tests/iii/overload-errors/case.json @@ -21,7 +21,7 @@ "line": 23 }, { - "reason": "built-in function and cannot be redefined", + "reason": "'EOF' is a built-in function and cannot be redefined", "line": 25 }, { diff --git a/tests/iii/overload-errors/program.cps b/tests/iii/overload-errors/program.cps index 13d4692..d510111 100644 --- a/tests/iii/overload-errors/program.cps +++ b/tests/iii/overload-errors/program.cps @@ -22,7 +22,7 @@ OVERLOAD PROCEDURE Bounds(a : ARRAY[1:2] OF INTEGER) ENDPROCEDURE OVERLOAD PROCEDURE Bounds(a : ARRAY[3:4] OF INTEGER) ENDPROCEDURE -OVERLOAD FUNCTION LENGTH(x : INTEGER) RETURNS INTEGER +OVERLOAD FUNCTION EOF(x : INTEGER) RETURNS INTEGER RETURN x ENDFUNCTION OUTPUT Exact("text") |
