summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/true_value.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-07-05 06:14:29 +0100
committerDamien George <damien.p.george@gmail.com>2014-07-05 06:14:29 +0100
commit539681fffd96082ca3b5d18643d4f08f65c47170 (patch)
tree7e6f8332c6e7737b768750e67265bb02b22932e6 /tests/basics/true_value.py
parent0182385ab0b4a1b2e549c92f8f5b621135aeb975 (diff)
downloadmicropython-539681fffd96082ca3b5d18643d4f08f65c47170.tar.gz
micropython-539681fffd96082ca3b5d18643d4f08f65c47170.zip
tests: Rename test scripts, changing - to _ for consistency.
From now on, all new tests must use underscore. Addresses issue #727.
Diffstat (limited to 'tests/basics/true_value.py')
-rw-r--r--tests/basics/true_value.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/basics/true_value.py b/tests/basics/true_value.py
new file mode 100644
index 0000000000..9ec209fe82
--- /dev/null
+++ b/tests/basics/true_value.py
@@ -0,0 +1,30 @@
+# Test true-ish value handling
+
+if not False:
+ print("False")
+
+if not None:
+ print("None")
+
+if not 0:
+ print("0")
+
+if not "":
+ print("Empty string")
+if "foo":
+ print("Non-empty string")
+
+if not ():
+ print("Empty tuple")
+if ("",):
+ print("Non-empty tuple")
+
+if not []:
+ print("Empty list")
+if [0]:
+ print("Non-empty list")
+
+if not {}:
+ print("Empty dict")
+if {0:0}:
+ print("Non-empty dict")