summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/set_basic.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2020-02-10 22:22:12 +1100
committerDamien George <damien.p.george@gmail.com>2020-02-11 11:06:17 +1100
commit27465e6b24e80fdcdaddd015fe8f690122f78ef8 (patch)
tree5bc93de146462c95e47eaa4374df6195e97d5e8e /tests/basics/set_basic.py
parent9ec1caf42e7733b5141b7aecf1b6e58834a94bf7 (diff)
downloadmicropython-27465e6b24e80fdcdaddd015fe8f690122f78ef8.tar.gz
micropython-27465e6b24e80fdcdaddd015fe8f690122f78ef8.zip
tests/basics: Add tests for equality between bool and int/float/complex.
False/True should be implicitly converted to 0/1 when compared with numeric types.
Diffstat (limited to 'tests/basics/set_basic.py')
-rw-r--r--tests/basics/set_basic.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/basics/set_basic.py b/tests/basics/set_basic.py
index 6ea69e4f05..2d1653622e 100644
--- a/tests/basics/set_basic.py
+++ b/tests/basics/set_basic.py
@@ -10,6 +10,10 @@ print(sorted(s))
s = {1 + len(s)}
print(s)
+# bools mixed with integers
+s = {False, True, 0, 1, 2}
+print(len(s))
+
# Sets are not hashable
try:
{s: 1}