aboutsummaryrefslogtreecommitdiff
path: root/tests/basics
diff options
context:
space:
mode:
authorDamien George2015-08-25 18:18:57 +0100
committerDamien George2015-08-29 23:13:28 +0100
commit1d350b8ac6c65bd53115bfdc7511e4028f3c69ac (patch)
treeb4f06dceff7101c8cacdb9e81b0fa30eca4f1735 /tests/basics
parenta488c266c34f70ab6bff86b1f31f1d1a343ab1b8 (diff)
tests: Add a few tests for bool, bytearray, float to improve coverage.
Diffstat (limited to 'tests/basics')
-rw-r--r--tests/basics/bool1.py6
-rw-r--r--tests/basics/bytearray1.py3
-rw-r--r--tests/basics/bytearray_add.py4
3 files changed, 13 insertions, 0 deletions
diff --git a/tests/basics/bool1.py b/tests/basics/bool1.py
index 99bd83792..35d9ed8cc 100644
--- a/tests/basics/bool1.py
+++ b/tests/basics/bool1.py
@@ -9,3 +9,9 @@ print(False or True)
# unary operators
print(+True)
print(-True)
+
+# unsupported unary op
+try:
+ len(False)
+except TypeError:
+ print('TypeError')
diff --git a/tests/basics/bytearray1.py b/tests/basics/bytearray1.py
index 76e7e5975..2e47f17bf 100644
--- a/tests/basics/bytearray1.py
+++ b/tests/basics/bytearray1.py
@@ -27,4 +27,7 @@ print(bytearray([1]) == b"1")
print(b"1" == bytearray([1]))
print(bytearray() == bytearray())
+# comparison with other type should return False
+print(bytearray() == 1)
+
# TODO: other comparisons
diff --git a/tests/basics/bytearray_add.py b/tests/basics/bytearray_add.py
index 21a386c6e..a7e2b5737 100644
--- a/tests/basics/bytearray_add.py
+++ b/tests/basics/bytearray_add.py
@@ -12,3 +12,7 @@ print(b)
# extend
b.extend(bytearray(4))
print(b)
+
+# this inplace add tests the code when the buffer doesn't need to be increased
+b = bytearray()
+b += b''