[Zodb-checkins] SVN: ZODB/trunk/src/BTrees/tests/testBTrees.py testItemsNegativeIndex (3 instances): repaired off-by-one glitch in loop (range(i, j, k) is always exclusive of j).

Tim Peters tim.one at comcast.net
Mon May 31 16:07:09 EDT 2004


Log message for revision 25139:
testItemsNegativeIndex (3 instances):  repaired off-by-one glitch in loop (range(i, j, k) is always exclusive of j).


-=-
Modified: ZODB/trunk/src/BTrees/tests/testBTrees.py
===================================================================
--- ZODB/trunk/src/BTrees/tests/testBTrees.py	2004-05-31 16:20:35 UTC (rev 25138)
+++ ZODB/trunk/src/BTrees/tests/testBTrees.py	2004-05-31 20:07:07 UTC (rev 25139)
@@ -212,7 +212,7 @@
             self.t[i] = i
         L.sort()
         vals = self.t.values()
-        for i in range(-1, -4, -1):
+        for i in range(-1, -5, -1):
             self.assertEqual(vals[i], L[i])
         self.assertRaises(IndexError, lambda: vals[-5])
 
@@ -241,7 +241,7 @@
             self.t[i] = i
         L.sort()
         keys = self.t.keys()
-        for i in range(-1, -4, -1):
+        for i in range(-1, -5, -1):
             self.assertEqual(keys[i], L[i])
         self.assertRaises(IndexError, lambda: keys[-5])
 
@@ -273,7 +273,7 @@
             self.t[i] = i
         L.sort()
         items = self.t.items()
-        for i in range(-1, -4, -1):
+        for i in range(-1, -5, -1):
             self.assertEqual(items[i], (L[i], L[i]))
         self.assertRaises(IndexError, lambda: items[-5])
 




More information about the Zodb-checkins mailing list