aboutsummaryrefslogtreecommitdiff
path: root/tests/test.sh
diff options
context:
space:
mode:
authorGravatar zinc <zinc@downsta.ir> 2026-10-14 09:33:03 +0000
committerGravatar zinc <zinc@downsta.ir> 2026-10-14 09:33:03 +0000
commitebaa15f02dd0e5aa358ea2e527ae4557e40b4e9c (patch)
tree9f53ccfed1eedd90df2747bdfd0e9ea907caee95 /tests/test.sh
parenttodo: record the reverted unchecked trial and what it showed (diff)
constants inside structs, and typo suggestions for fields and static members
const NAME = e; inside a struct body declares a compile-time constant named Struct.NAME, reached as Struct.NAME or by bare name in the struct's methods. A misspelled field or Struct.name member now ends its error with '; did you mean 'name'?' on the member word, which the language server turns into a quick fix.
Diffstat (limited to 'tests/test.sh')
-rwxr-xr-xtests/test.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/test.sh b/tests/test.sh
index 46625a6..7ae7b9d 100755
--- a/tests/test.sh
+++ b/tests/test.sh
@@ -123,6 +123,7 @@ run(){ # $1 = vm command, $2 = label
chk "$($vm < tests/programs/generics.zc | md5sum)" "$(md5sum < tests/programs/generics.expected)" "$l generic functions are compiled per type arguments"
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/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"