]> granicus.if.org Git - python/commitdiff
Added some single tuple/list unpacking for JPython regression testing.
authorBarry Warsaw <barry@python.org>
Thu, 12 Oct 2000 14:45:58 +0000 (14:45 +0000)
committerBarry Warsaw <barry@python.org>
Thu, 12 Oct 2000 14:45:58 +0000 (14:45 +0000)
Lib/test/test_unpack.py

index 25324c053a3fb87d0663114baaba7c27728722b8..25b94e973889fcf9b100e0a19a3536cdf6bee34e 100644 (file)
@@ -47,6 +47,18 @@ a, b, c = Seq()
 if a <> 0 or b <> 1 or c <> 2:
     raise TestFailed
 
+# single element unpacking, with extra syntax
+if verbose:
+    print 'unpack single tuple/list'
+st = (99,)
+sl = [100]
+a, = st
+if a <> 99:
+    raise TestFailed
+b, = sl
+if b <> 100:
+    raise TestFailed
+
 # now for some failures
 
 # unpacking non-sequence