Beispiel #1
0
 def test_linear_partial(self):
     self.assertEquals(list(linear_search(range(8, 14), self.condition)),
                       [10, 11, 12, 13])
     self.assertEquals(list(linear_search(range(11, 14), self.condition)),
                       [11, 12, 13])
     self.assertEquals(list(linear_search(range(12, 18), self.condition)),
                       [12, 13, 14])
Beispiel #2
0
 def test_linear_partial(self):
     self.assertEquals(list(linear_search(range(8, 14), self.condition)),
                       [10, 11, 12, 13])
     self.assertEquals(list(linear_search(range(11, 14), self.condition)),
                       [11, 12, 13])
     self.assertEquals(list(linear_search(range(12, 18), self.condition)),
                       [12, 13, 14])
Beispiel #3
0
 def test_linear_empty(self):
     self.assertEquals(list(linear_search(range(1, 4), self.condition)), [])
Beispiel #4
0
 def test_linear_full(self):
     self.assertEquals(list(linear_search(range(21), self.condition)),
                       [10, 11, 12, 13, 14])
Beispiel #5
0
 def test_linear_empty(self):
     self.assertEquals(list(linear_search(range(1, 4), self.condition)), [])
Beispiel #6
0
 def test_linear_full(self):
     self.assertEquals(list(linear_search(range(21), self.condition)),
                       [10, 11, 12, 13, 14])