将 .py 和 .pyi 后缀名改为了 .vp 和 .vpi 后缀名

This commit is contained in:
2026-07-30 16:34:50 +08:00
parent 32af3f93fa
commit d227bee139
74 changed files with 42 additions and 25 deletions

View File

@@ -0,0 +1,37 @@
import stdio
import t, c
import string
import testcheck
# ============================================================
# testcheck_test - 测试 includes/testcheck 库导入与调用
#
# 验证命名空间隔离下import testcheck + 模块限定函数调用能正常工作。
# 同时测试 string 库的模块限定调用。
# ============================================================
def testcheck_test() -> int:
testcheck.begin("testcheck_test")
testcheck.section("Arithmetic")
a: int = 3 + 4
testcheck.check(a == 7, "3+4=7", "3+4!=7")
b: int = 10 - 3
testcheck.check(b == 7, "10-3=7", "10-3!=7")
m: int = 6 * 7
testcheck.check(m == 42, "6*7=42", "6*7!=42")
testcheck.section("String")
slen: int = string.strlen("hello")
testcheck.check(slen == 5, "strlen(hello)=5", "strlen(hello)!=5")
scmp: int = string.strcmp("abc", "abc")
testcheck.check(scmp == 0, "strcmp(abc,abc)=0", "strcmp(abc,abc)!=0")
testcheck.section("Module Import")
testcheck.info("testcheck module imported and called successfully")
testcheck.ok("import testcheck works")
return testcheck.end()