From c2fe618575aaf58ddf36d04d96431d6dc819ef31 Mon Sep 17 00:00:00 2001 From: Tim Peters Date: Tue, 30 Oct 2001 23:20:46 +0000 Subject: Fix bad bug in structseq slicing (NULL pointers in result). Reported by Jack Jansen on python-dev. Add simple test case. Move vereq() from test_descr to test_support (it's handy!). --- Lib/test/test_structseq.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Lib/test/test_structseq.py (limited to 'Lib/test/test_structseq.py') diff --git a/Lib/test/test_structseq.py b/Lib/test/test_structseq.py new file mode 100644 index 0000000000..33d3313a14 --- /dev/null +++ b/Lib/test/test_structseq.py @@ -0,0 +1,16 @@ +from test_support import vereq + +import time + +t = time.gmtime() +astuple = tuple(t) +vereq(len(t), len(astuple)) +vereq(t, astuple) + +# Check that slicing works the same way; at one point, slicing t[i:j] with +# 0 < i < j could produce NULLs in the result. +for i in range(-len(t), len(t)): + for j in range(-len(t), len(t)): + vereq(t[i:j], astuple[i:j]) + +XXX more needed -- cgit v1.2.1