File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -34,9 +34,46 @@ def test_02():
3434 print (w )
3535 assert w == u32 (11 )
3636
37+ def test_03 ():
38+ x : u32 = u32 (- 10 )
39+ print (x )
40+ assert x == u32 (4294967286 )
41+
42+ y : u16 = u16 (x )
43+ print (y )
44+ assert y == u16 (65526 )
45+
46+ z : u64 = u64 (y )
47+ print (z )
48+ assert z == u64 (65526 )
49+
50+ w : u8 = u8 (z )
51+ print (w )
52+ assert w == u8 (246 )
53+
54+ def test_04 ():
55+ x : u64 = u64 (- 11 )
56+ print (x )
57+ # TODO: We are unable to store the following u64 in AST/R
58+ # assert x == u64(18446744073709551605)
59+
60+ y : u8 = u8 (x )
61+ print (y )
62+ assert y == u8 (245 )
63+
64+ z : u16 = u16 (y )
65+ print (z )
66+ assert z == u16 (245 )
67+
68+ w : u32 = u32 (z )
69+ print (w )
70+ assert w == u32 (245 )
71+
3772
3873def main0 ():
3974 test_01 ()
4075 test_02 ()
76+ test_03 ()
77+ test_04 ()
4178
4279main0 ()
You can’t perform that action at this time.
0 commit comments