[Zodb-checkins] CVS: Zope/lib/python/BTrees/tests - testSetOps.py:1.3
Tim Peters
tim.one@comcast.net
Fri, 31 May 2002 19:46:53 -0400
Update of /cvs-repository/Zope/lib/python/BTrees/tests
In directory cvs.zope.org:/tmp/cvs-serv30763/tests
Modified Files:
testSetOps.py
Log Message:
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.
=== Zope/lib/python/BTrees/tests/testSetOps.py 1.2 => 1.3 ===
def testBigInput(self):
- input = IISet(range(50000))
- reversed = range(50000)
- reversed.reverse()
- reversed = IISet(reversed)
- output = multiunion([input, reversed] * 5)
- self.assertEqual(len(output), 50000)
- self.assertEqual(list(output), range(50000))
+ N = 100000
+ input = IISet(range(N))
+ output = multiunion([input] * 10)
+ self.assertEqual(len(output), N)
+ self.assertEqual(output.minKey(), 0)
+ self.assertEqual(output.maxKey(), N-1)
+ self.assertEqual(list(output), range(N))
def testLotsOfLittleOnes(self):
from random import shuffle