diff options
author | John R. Lenton <jlenton@gmail.com> | 2014-01-03 22:53:18 +0000 |
---|---|---|
committer | John R. Lenton <jlenton@gmail.com> | 2014-01-03 22:53:18 +0000 |
commit | 25f417c08c2cdb5c4a7564d1e69766c0448d7984 (patch) | |
tree | fa65aad41dcfbd4a428709b408f205a1b30b03ae /tests/basics | |
parent | 9bc56d933f885d4231e047a25af2becbb1354ce3 (diff) | |
download | micropython-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.py | 11 |
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") |