diff options
| author | 2026-10-14 10:38:17 +0000 | |
|---|---|---|
| committer | 2026-10-14 10:38:17 +0000 | |
| commit | 93340f97dce404a008f489729df144ace53528ab (patch) | |
| tree | cbada309f3a4683d083d84484f11952418c8dd2b /tests/test.sh | |
| parent | todo: handoff section with state, conventions, in-flight work and architectur... (diff) | |
fix std hover, full capture terminator, bare static calls, void main in run-only images
- hover: a symbol from an embedded library source (tinyvm:std.zc, tinyvm:icon.zc) was
looked up only in the document; look it up by its qualified name in the library source
(hover_embedded_sym), and render a method found that way by its line (bs_hover).
- std.capture: allocate one word more than the 256 it holds, so end() terminates inside the buffer.
- a bare call to a static function of the enclosing struct resolves like a bare struct constant
(mstruct is set for every non-generic struct's methods); the struct's own wins over a global.
- run.zc declares main untyped (fn main();), so a run-only image accepts int, void or untyped main
with both compilers.
Diffstat (limited to 'tests/test.sh')
| -rwxr-xr-x | tests/test.sh | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/test.sh b/tests/test.sh index 298c356..c800e8f 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -128,6 +128,7 @@ run(){ # $1 = vm command, $2 = label chk "$($vm < tests/programs/genmeth.zc | md5sum)" "$(md5sum < tests/programs/genmeth.expected)" "$l methods of generic structs are compiled per type arguments" chk "$($vm < tests/programs/static.zc)" "14 5 9" "$l static functions of a struct are called as Struct.name(args)" chk "$($vm < tests/programs/struct_const.zc)" "24 49 24 23 19 55 12 99" "$l constants declared in a struct are reached as Struct.NAME, and by bare name in its methods" + chk "$($vm < tests/programs/struct_static_call.zc)" "3 100 11 8 1010 7" "$l a static function of a struct is called by its bare name in its methods, and wins over a global of the same name" chk "$($vm < tests/programs/methodown.zc)" "7 9" "$l struct methods and functions return owned objects (.u)" chk "$($vm < tests/programs/typedmethods.zc)" "14 5 13" "$l struct methods declare a return type and typed parameters" chk "$($vm < tests/programs/enumscope.zc)" "0 5 6 blue" "$l enum members are reached as Enum.MEMBER, also in a case" @@ -158,6 +159,9 @@ hello world!42 1 1 0" "$l capture.start() collects output and end() hands back the string" + chk "$($vm < tests/programs/capture_long.zc)" "7 +256 +v" "$l a full capture is still terminated inside its buffer" chk "$($vm < tests/programs/sys.zc)" "2 zy time" "$l syscalls: write, read, time" chk "$($vm < tests/programs/memleak.zc)" $'leak: line 8 3 words\n1' "$l memdebug names a live allocation" chk "$($vm < tests/programs/uaf.zc)" $'zc: line 10: warning: use after free: this storage\'s lifetime ended on line 9\nzy: use after free from line 7' "$l memdebug: use after free" @@ -353,6 +357,7 @@ s_runonly() { runonly wide tests/programs/wide.zc runonly selfpatch examples/selfpatch.zc runonly gc tests/programs/gc.zc + runonly voidmain tests/programs/void_main.zc runonly float tests/programs/float.zc runonly ftruth tests/programs/ftruth.zc runonly ftext tests/programs/ftext.zc |
