Lines Matching refs:test
4 def test(code): function
12 test("@micropython.viper\ndef f(a:1): pass")
13 test("@micropython.viper\ndef f() -> 1: pass")
16 test("@micropython.viper\ndef f(x:unknown_type): pass")
19 test(
29 test(
40 test(
51 test("@micropython.viper\ndef f() -> int: return []")
54 test("@micropython.viper\ndef f(): 1 + []")
55 test("@micropython.viper\ndef f(x:int, y:uint): x < y")
58 test("@micropython.viper\ndef f(): 1[0]")
59 test("@micropython.viper\ndef f(): 1[x]")
62 test("@micropython.viper\ndef f(): 1[0] = 1")
63 test("@micropython.viper\ndef f(): 1[x] = 1")
64 test("@micropython.viper\ndef f(x:int): x[0] = x")
65 test("@micropython.viper\ndef f(x:ptr32): x[0] = None")
66 test("@micropython.viper\ndef f(x:ptr32): x[x] = None")
69 test("@micropython.viper\ndef f(): raise 1")
72 test("@micropython.viper\ndef f(x:int): +x")
73 test("@micropython.viper\ndef f(x:int): -x")
74 test("@micropython.viper\ndef f(x:int): ~x")
77 test("@micropython.viper\ndef f(x:uint, y:uint): res = x // y")
78 test("@micropython.viper\ndef f(x:uint, y:uint): res = x % y")
79 test("@micropython.viper\ndef f(x:int): res = x in x")
82 test("@micropython.viper\ndef f(): yield")
83 test("@micropython.viper\ndef f(): yield from f")
86 test("@micropython.viper\ndef f(): print(ptr(1))")
89 test("@micropython.viper\ndef f(): int(int)")