diff options
-rw-r--r-- | Lib/test/output/test_builtin | 1 | ||||
-rw-r--r-- | Lib/test/test_b1.py | 10 | ||||
-rw-r--r-- | Lib/test/test_b2.py | 4 |
3 files changed, 14 insertions, 1 deletions
diff --git a/Lib/test/output/test_builtin b/Lib/test/output/test_builtin index 1c3b69c..6c1b9aa 100644 --- a/Lib/test/output/test_builtin +++ b/Lib/test/output/test_builtin @@ -26,6 +26,7 @@ int isinstance issubclass len +list long map max diff --git a/Lib/test/test_b1.py b/Lib/test/test_b1.py index 17f0411..8d47abc 100644 --- a/Lib/test/test_b1.py +++ b/Lib/test/test_b1.py @@ -491,6 +491,16 @@ if len([1, 2, 3, 4]) != 4: raise TestFailed, 'len([1, 2, 3, 4])' if len({}) != 0: raise TestFailed, 'len({})' if len({'a':1, 'b': 2}) != 2: raise TestFailed, 'len({\'a\':1, \'b\': 2})' +print 'list' +if list([]) != []: raise TestFailed, 'list([])' +l0_3 = [0, 1, 2, 3] +l0_3_bis = list(l0_3) +if l0_3 != l0_3_bis or l0_3 is l0_3_bis: raise TestFailed, 'list([0, 1, 2, 3])' +if list(()) != []: raise TestFailed, 'list(())' +if list((0, 1, 2, 3)) != [0, 1, 2, 3]: raise TestFailed, 'list((0, 1, 2, 3))' +if list('') != []: raise TestFailed, 'list('')' +if list('spam') != ['s', 'p', 'a', 'm']: raise TestFailed, "list('spam')" + print 'long' if long(314) != 314L: raise TestFailed, 'long(314)' if long(3.14) != 3L: raise TestFailed, 'long(3.14)' diff --git a/Lib/test/test_b2.py b/Lib/test/test_b2.py index c5af1b3..b930380 100644 --- a/Lib/test/test_b2.py +++ b/Lib/test/test_b2.py @@ -253,7 +253,9 @@ if str({}) != '{}': raise TestFailed, 'str({})' print 'tuple' if tuple(()) != (): raise TestFailed, 'tuple(())' -if tuple((0, 1, 2, 3)) != (0, 1, 2, 3): raise TestFailed, 'tuple((0, 1, 2, 3))' +t0_3 = (0, 1, 2, 3) +t0_3_bis = tuple(t0_3) +if t0_3 is not t0_3_bis: raise TestFailed, 'tuple((0, 1, 2, 3))' if tuple([]) != (): raise TestFailed, 'tuple([])' if tuple([0, 1, 2, 3]) != (0, 1, 2, 3): raise TestFailed, 'tuple([0, 1, 2, 3])' if tuple('') != (): raise TestFailed, 'tuple('')' |