Keep BASIC fixtures within the input line limit

Reflow the approved reference cases, shorten local fixture comments, and split the executable docs line so the 80-byte input buffer can read every source line.

Co-authored-by: andrew <andrew@aklabs.net>
This commit is contained in:
2026-08-04 16:12:42 -04:00
committed by Tachikoma
parent 4bfcf72240
commit 1a7226eef1
17 changed files with 39 additions and 38 deletions

View File

@@ -1,6 +1,6 @@
10 PRINT MOD(10, 3)
20 PRINT MOD(12, 5)
30 PRINT MOD(4, 2)
40 REM MOD() ONLY WORKS WITH INTEGERS - RESULTS WITH FLOATING POINT ARE UNRELIABLE
40 REM MOD() ONLY WORKS WITH INTEGERS - FLOATING-POINT RESULTS ARE UNRELIABLE
50 REM PRINT MOD(1.2, 0.4)
60 REM THERE IS NO ERROR THROWN HERE. JUST DONT DO IT.

View File

@@ -1,6 +1,6 @@
10 REM A DEF call takes its environment from the pool, one per call, exactly as
10 REM A DEF call takes an environment from the pool, one per call, exactly as
20 REM GOSUB does. It used to be owned by the funcdef and reset on every call,
30 REM which cost two silent defects: two calls in one expression shared a slot,
30 REM which cost two silent defects: two calls shared a slot,
40 REM and recursion never came back at all.
50 DEF FACT(N#)
60 IF N# <= 1 THEN RETURN 1
@@ -15,9 +15,9 @@
150 DEF DBL(N#) = N# * 2
160 PRINT DBL(10) + DBL(1)
170 PRINT DBL(1) + DBL(10) + DBL(100)
180 REM Depth answers to the environment pool now, so runaway recursion reports
190 REM "Environment pool exhausted" rather than hanging. It is not exercised here
200 REM because the statement containing a failed call still prints a junk value
210 REM afterwards -- a separate, pre-existing defect recorded in TODO.md, and one
220 REM this golden file would pin if it went in. tests/user_functions.c asserts
180 REM Depth answers to the pool, so runaway recursion reports
190 REM "Environment pool exhausted" rather than hanging. It is not exercised
200 REM here because a failed call's statement still prints a junk value
210 REM afterwards -- a TODO.md defect this file would pin
220 REM if it went in. tests/user_functions.c asserts
230 REM the message instead.