summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics
diff options
context:
space:
mode:
authorJohn R. Lenton <jlenton@gmail.com>2014-01-03 22:53:18 +0000
committerJohn R. Lenton <jlenton@gmail.com>2014-01-03 22:53:18 +0000
commit25f417c08c2cdb5c4a7564d1e69766c0448d7984 (patch)
treefa65aad41dcfbd4a428709b408f205a1b30b03ae /tests/basics
parent9bc56d933f885d4231e047a25af2becbb1354ce3 (diff)
downloadmicropython-25f417c08c2cdb5c4a7564d1e69766c0448d7984.tar.gz
micropython-25f417c08c2cdb5c4a7564d1e69766c0448d7984.zip
Worked on list.pop:
* Fixes issue #51 * Adds a specific error message for when you try to pop an empty list. * Releases some memory if the list has shurnk a lot.
Diffstat (limited to 'tests/basics')
-rw-r--r--tests/basics/tests/list3.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/basics/tests/list3.py b/tests/basics/tests/list3.py
new file mode 100644
index 0000000000..bb2ccc6d67
--- /dev/null
+++ b/tests/basics/tests/list3.py
@@ -0,0 +1,11 @@
+# list poppin'
+a = [1, 2, 3]
+print(a.pop())
+print(a.pop())
+print(a.pop())
+try:
+ print(a.pop())
+except IndexError:
+ print("IndexError raised")
+else:
+ raise AssertionError("No IndexError raised")