chore(test): 迁移测试夹具到新语法
机械规则 R2/R3/R4/R6/R7/R8/R13 + R16 保守子集,共 86 文件 2127 行。R1(T | t.CPtr)与 R12(while 下标循环)未做,仍列为待办。全量 77/77 顺序回归通过。
This commit is contained in:
1 parent
c9d741c202
commit
f5da836fbb
86 files changed
+2121
-2121
No files matched your search
@@ -119,15 +119,15 @@ def main() -> CInt | CExport:
|
||||
# === 新语法类型强转 (t1|t2)(x) ===
|
||||
testcheck.section("新语法类型强转 (t1|t2)(x)")
|
||||
val_i64: CUInt64T = CUInt64T(42)
|
||||
val_i32 = (t.CInt)(val_i64)
|
||||
val_i32 = (int)(val_i64)
|
||||
print(val_i32)
|
||||
|
||||
ptr_raw = stdlib.malloc(8)
|
||||
ptr_typed = (t.CInt | t.CPtr)(ptr_raw)
|
||||
ptr_typed = (int | t.CPtr)(ptr_raw)
|
||||
viperlib.snprintf(buf, 256, "cast ptr=%p", ptr_typed)
|
||||
print(buf)
|
||||
|
||||
val_f = (t.CDouble)(42)
|
||||
val_f = (double)(42)
|
||||
viperlib.snprintf(buf, 256, "cast float=%.1f", val_f)
|
||||
print(buf)
|
||||
testcheck.ok("新语法类型强转测试完成")
|
||||
|
||||
Reference in new issue
Block a user