]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Add test for core dump -- make sure it doesn't come back!
authorGuido van Rossum <guido@python.org>
Wed, 25 Feb 1998 17:51:50 +0000 (17:51 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 25 Feb 1998 17:51:50 +0000 (17:51 +0000)
Lib/test/test_types.py

index 7cca131c7e2122a6fbc8dfe81948859fa332f85d..6be66ca17c41f1b206034a177e300507b979b10f 100644 (file)
@@ -161,6 +161,11 @@ if a <> [-2,-1,0,1,2]: raise TestFailed, 'list sort'
 def revcmp(a, b): return cmp(b, a)
 a.sort(revcmp)
 if a <> [2,1,0,-1,-2]: raise TestFailed, 'list sort with cmp func'
+# The following dumps core in unpatched Python 1.5:
+def myComparison(x,y):
+    return cmp(x%3, y%7)
+z = range(12)
+z.sort(myComparison)
 
 print '6.6 Mappings == Dictionaries'
 d = {}