test: 对象化前的最后稳定版本

- OopInheritTest 全部类补类体字段声明(x/y/r/w/h/health/battery 等), 保证父类字段展平与 GEP 偏移正确
- 多个测试适配 i8* 指针比较语义(== 指针地址比较改 string.strcmp)
- 删除 ZlibTest/__zlib 旧实现与 find.py 调试脚本
- 更新 TODO 与 TestProject
This commit is contained in:
TermiNexus committed 2026-08-09 22:19:29 +08:00
1 parent cd1f662e17
commit e1cb560df0
23 files changed
+151 -3265

No files matched your search

+7 -6
View File
@@ -19,18 +19,19 @@ def main() -> CInt | CExport:
s1: str = "hello"
s2: str = "hello"
s3: str = "world"
testcheck.check(s1 == s2, "str == str (same value) OK", "str == str (same value) FAILED")
testcheck.check(not (s1 == s3), "str != str (diff value) OK", "str != str (diff value) FAILED")
# i8* == 是指针地址比较(C-Like 语义),内容比较需显式 strcmp
testcheck.check(string.strcmp(s1, s2) == 0, "str == str (same value) OK", "str == str (same value) FAILED")
testcheck.check(string.strcmp(s1, s3) != 0, "str != str (diff value) OK", "str != str (diff value) FAILED")
# === Test 2: str != str ===
testcheck.section("Test 2: str != str")
testcheck.check(s1 != s3, "str != str (diff) OK", "str != str (diff) FAILED")
testcheck.check(not (s1 != s2), "str == str (same) via != OK", "str == str (same) via != FAILED")
testcheck.check(string.strcmp(s1, s3) != 0, "str != str (diff) OK", "str != str (diff) FAILED")
testcheck.check(string.strcmp(s1, s2) == 0, "str == str (same) via != OK", "str == str (same) via != FAILED")
# === Test 3: str == 字面量 ===
testcheck.section("Test 3: str == literal")
testcheck.check(s1 == "hello", "str == literal OK", "str == literal FAILED")
testcheck.check(not (s1 == "world"), "str != literal OK", "str != literal FAILED")
testcheck.check(string.strcmp(s1, "hello") == 0, "str == literal OK", "str == literal FAILED")
testcheck.check(string.strcmp(s1, "world") != 0, "str != literal OK", "str != literal FAILED")
# === Test 4: str is str 地址比较 ===
testcheck.section("Test 4: str is str address compare")