diff options
author | Damien George <damien.p.george@gmail.com> | 2015-03-12 22:47:44 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-03-12 22:48:45 +0000 |
commit | af43565322f5c45a1a92df1afceff24c93021998 (patch) | |
tree | 0334982a350b9201b8e0b256dc7c04dff8b3ea77 /tests/basics/unpack1.py | |
parent | 848dd0e7620b086f984fc6254afc8202d5448a77 (diff) |
tests: Add tests for things that are not already tested.
The aim here is to improve coverage of the code.
Diffstat (limited to 'tests/basics/unpack1.py')
-rw-r--r-- | tests/basics/unpack1.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/basics/unpack1.py b/tests/basics/unpack1.py index b2b2ddb7e..10e01dea0 100644 --- a/tests/basics/unpack1.py +++ b/tests/basics/unpack1.py @@ -2,8 +2,23 @@ a, = 1, ; print(a) a, b = 2, 3 ; print(a, b) +a, b, c = 1, 2, 3; print(a, b, c) +a, = range(1); print(a) a, b = range(2); print(a, b) +a, b, c = range(3); print(a, b, c) + +(a) = range(1); print(a) +(a,) = range(1); print(a) +(a, b) = range(2); print(a, b) +(a, b, c) = range(3); print(a, b, c) + +# lists + +[] = [] +[a] = range(1); print(a) +[a, b] = range(2); print(a, b) +[a, b, c] = range(3); print(a, b, c) # with star @@ -27,6 +42,9 @@ a = [28, 29] *b, = a print(a, b, a == b) +[*a] = [1, 2, 3] +print(a) + try: a, *b, c = (30,) except ValueError: |