Update version number and release date.
[python/dscho.git] / Lib / test / test_structseq.py
blob2760d722b4e724830570dc035afb74453979de3a
1 from test.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