diff options
author | Damien George <damien.p.george@gmail.com> | 2015-01-29 00:44:11 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-01-29 00:44:11 +0000 |
commit | 12c66be2b8baab093c7be5e2108d2767c9779a69 (patch) | |
tree | 7db0c4259eaae84cea25d79b3856fc08d863cef1 /tests/basics/int_small.py | |
parent | 81e70a88a7a4adb33c4a5d049c83f42d94e6332b (diff) | |
download | micropython-12c66be2b8baab093c7be5e2108d2767c9779a69.tar.gz micropython-12c66be2b8baab093c7be5e2108d2767c9779a69.zip |
tests: Add some tests to improve coverage.
Used gcov to find some parts of vm.c, runtime.c, obj.c that were not
covered by any tests. Still need to use gcov more thoroughly.
Diffstat (limited to 'tests/basics/int_small.py')
-rw-r--r-- | tests/basics/int_small.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/basics/int_small.py b/tests/basics/int_small.py index 1b2c983e23..496e830d26 100644 --- a/tests/basics/int_small.py +++ b/tests/basics/int_small.py @@ -49,6 +49,15 @@ print(a) # This would overflow #a -= 1 +# negative shifts are not allowed +try: + a << -1 +except ValueError: + print("ValueError") +try: + a >> -1 +except ValueError: + print("ValueError") # Shifts to big amounts are undefined behavior in C and is CPU-specific |