Commit b90f4bda authored by Tim Peters's avatar Tim Peters

testBigInput(): This spent almost all of its time building an IISet

from a sequence of ints in reverse-sorted order (a quadratic-time
proposition).  That doesn't test anything interesting in context, though.
So fiddled it to do a larger input, but it runs much faster now.
parent 9aa488d9
...@@ -48,13 +48,13 @@ class TestMultiUnion(TestCase): ...@@ -48,13 +48,13 @@ class TestMultiUnion(TestCase):
self.assertEqual([1, 3, 5], list(output)) self.assertEqual([1, 3, 5], list(output))
def testBigInput(self): def testBigInput(self):
input = IISet(range(50000)) N = 100000
reversed = range(50000) input = IISet(range(N))
reversed.reverse() output = multiunion([input] * 10)
reversed = IISet(reversed) self.assertEqual(len(output), N)
output = multiunion([input, reversed] * 5) self.assertEqual(output.minKey(), 0)
self.assertEqual(len(output), 50000) self.assertEqual(output.maxKey(), N-1)
self.assertEqual(list(output), range(50000)) self.assertEqual(list(output), range(N))
def testLotsOfLittleOnes(self): def testLotsOfLittleOnes(self):
from random import shuffle from random import shuffle
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment