- Got rid of newmodule.c
[python/dscho.git] / Lib / test / test_structseq.py
blobc09e0691cd84a0e7dcbdca1aeccb8a83648ccad4
1 from test_support import vereq
3 import time
5 t = time.gmtime()
6 astuple = tuple(t)
7 vereq(len(t), len(astuple))
8 vereq(t, astuple)
10 # Check that slicing works the same way; at one point, slicing t[i:j] with
11 # 0 < i < j could produce NULLs in the result.
12 for i in range(-len(t), len(t)):
13 for j in range(-len(t), len(t)):
14 vereq(t[i:j], astuple[i:j])
16 # Devious code could crash structseqs' contructors
17 class C:
18 def __getitem__(self, i):
19 raise IndexError
20 def __len__(self):
21 return 9
23 try:
24 repr(time.struct_time(C()))
25 except:
26 pass
28 # XXX more needed