mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-02 17:29:22 +01:00
Fixed tests for all; added additional test cases for the empty sequence.
This commit is contained in:
parent
da7e321be9
commit
4cb7c18392
@ -71,11 +71,14 @@ class FunctionsTest(unittest.TestCase):
|
|||||||
self.failUnless(any(lambda i: i == 0, range(10)))
|
self.failUnless(any(lambda i: i == 0, range(10)))
|
||||||
self.failIf(any(None, range(1)))
|
self.failIf(any(None, range(1)))
|
||||||
self.failUnless(any(None, range(2)))
|
self.failUnless(any(None, range(2)))
|
||||||
|
self.failIf(any(None, []))
|
||||||
|
|
||||||
def testAll(self):
|
def testAll(self):
|
||||||
self.failIf(all(lambda i: i == 0, range(10)))
|
self.failIf(all(lambda i: i == 0, range(10)))
|
||||||
self.failUnless(any(lambda i: i % 2, range(2)))
|
self.failIf(all(lambda i: i % 2, range(2)))
|
||||||
self.failIf(any(lambda i: i % 2 == 0, [1, 3, 5]))
|
self.failIf(all(lambda i: i % 2 == 0, [1, 3, 5]))
|
||||||
|
self.failUnless(all(lambda i: i % 2 == 0, [2, 4, 6]))
|
||||||
|
self.failUnless(all(None, ()))
|
||||||
|
|
||||||
def testPartition(self):
|
def testPartition(self):
|
||||||
L = range(10)
|
L = range(10)
|
||||||
|
Loading…
Reference in New Issue
Block a user