diff options
Diffstat (limited to 'tests/micropython/viper_error.py')
| -rw-r--r-- | tests/micropython/viper_error.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/micropython/viper_error.py b/tests/micropython/viper_error.py index 80617af0c..6c5c3ba20 100644 --- a/tests/micropython/viper_error.py +++ b/tests/micropython/viper_error.py @@ -50,6 +50,9 @@ def f(): # incorrect return type test("@micropython.viper\ndef f() -> int: return []") +# can't do unary op of incompatible type +test("@micropython.viper\ndef f(x:ptr): -x") + # can't do binary op between incompatible types test("@micropython.viper\ndef f(): 1 + []") test("@micropython.viper\ndef f(x:int, y:uint): x < y") @@ -69,9 +72,7 @@ test("@micropython.viper\ndef f(x:ptr32): x[x] = None") test("@micropython.viper\ndef f(): raise 1") # unary ops not implemented -test("@micropython.viper\ndef f(x:int): +x") -test("@micropython.viper\ndef f(x:int): -x") -test("@micropython.viper\ndef f(x:int): ~x") +test("@micropython.viper\ndef f(x:int): not x") # binary op not implemented test("@micropython.viper\ndef f(x:uint, y:uint): res = x // y") |
