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
+4
-4
@@ -38,15 +38,15 @@ def test_value_struct_fields():
|
||||
node.IntVal = 42
|
||||
node.FloatVal = 3.14
|
||||
# 读取验证
|
||||
v: t.CInt = node.IntVal
|
||||
v: int = node.IntVal
|
||||
testcheck.check(v == 42, "Value.IntVal = 42", "expect 42")
|
||||
f: t.CDouble = node.FloatVal
|
||||
f: double = node.FloatVal
|
||||
testcheck.check(f > 3.0 and f < 4.0, "Value.FloatVal = 3.14", "expect ~3.14")
|
||||
c: t.CInt = node.IsConst
|
||||
c: int = node.IsConst
|
||||
testcheck.check(c == 1, "Value.IsConst = 1", "expect 1")
|
||||
|
||||
|
||||
def main() -> t.CInt:
|
||||
def main() -> int:
|
||||
testcheck.begin("G7: Minimal repro - class name 'Value' conflicts with variable")
|
||||
test_value_struct_fields()
|
||||
return testcheck.end()
|
||||
@@ -17,9 +17,9 @@ from linkedlist import GSListNode
|
||||
class Value(GSListNode[Value]):
|
||||
Ty: t.CPtr
|
||||
Name: t.CPtr
|
||||
IsConst: t.CInt
|
||||
IntVal: t.CInt64T
|
||||
FloatVal: t.CDouble
|
||||
IsConst: int
|
||||
IntVal: int64
|
||||
FloatVal: double
|
||||
|
||||
def __init__(self):
|
||||
self.Ty = None
|
||||
|
||||
Reference in new issue
Block a user