summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-10-08 13:08:59 +0100
committerDamien George <damien.p.george@gmail.com>2015-10-08 13:08:59 +0100
commit9f5f156b9d911b6c6282eb4cf0e4f8a9129169c5 (patch)
tree64e6bb8a2ea96a2fdcc59561f31edb9656cfb6af /tests
parent7e12a601b8e9d90e5a7498523a9023c8c47bc4ca (diff)
py/emitnative: Raise ViperTypeError for unsupported unary ops.
Diffstat (limited to 'tests')
-rw-r--r--tests/micropython/viper_error.py5
-rw-r--r--tests/micropython/viper_error.py.exp3
2 files changed, 8 insertions, 0 deletions
diff --git a/tests/micropython/viper_error.py b/tests/micropython/viper_error.py
index 0762f5079..116bd4ea0 100644
--- a/tests/micropython/viper_error.py
+++ b/tests/micropython/viper_error.py
@@ -52,3 +52,8 @@ test("@micropython.viper\ndef f(): 1[x] = 1")
# must raise an object
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")
diff --git a/tests/micropython/viper_error.py.exp b/tests/micropython/viper_error.py.exp
index ad1ba34c6..1afcd4bdb 100644
--- a/tests/micropython/viper_error.py.exp
+++ b/tests/micropython/viper_error.py.exp
@@ -10,3 +10,6 @@ ViperTypeError("can't load from 'int'",)
ViperTypeError("can't store to 'int'",)
ViperTypeError("can't store to 'int'",)
ViperTypeError('must raise an object',)
+ViperTypeError('unary op __pos__ not implemented',)
+ViperTypeError('unary op __neg__ not implemented',)
+ViperTypeError('unary op __invert__ not implemented',)