Exemplo n.º 1
0
 def test_different_lists(self):
     self.assertEqual(
         check_lists([1, 2, 3], [2, 3, 4]),
         UNEQUAL
     )
Exemplo n.º 2
0
 def test_at_start_of_superlist(self):
     l1 = [0, 1, 2, 3, 4, 5]
     l2 = [0, 1, 2]
     self.assertEqual(check_lists(l1, l2), SUPERLIST)
Exemplo n.º 3
0
 def test_non_empty_list_contains_empty_list(self):
     self.assertEqual(
         check_lists([1, 2, 3], []),
         SUPERLIST
     )
Exemplo n.º 4
0
 def test_sublist_at_end(self):
     l1 = [3, 4, 5]
     l2 = [0, 1, 2, 3, 4, 5]
     self.assertEqual(SUBLIST, check_lists(l1, l2))
Exemplo n.º 5
0
 def test_large_lists(self):
     l1 = list(range(1000))*1000 + list(range(1000, 1100))
     l2 = list(range(900, 1050))
     self.assertEqual(SUPERLIST, check_lists(l1, l2))
Exemplo n.º 6
0
 def test_at_end_of_superlist(self):
     self.assertEqual(
         check_lists([0, 1, 2, 3, 4, 5], [3, 4, 5]),
         SUPERLIST
     )
Exemplo n.º 7
0
 def test_different_lists(self):
     l1 = list(range(1000000))
     l2 = list(range(1, 1000001))
     self.assertEqual(UNEQUAL, check_lists(l1, l2))
Exemplo n.º 8
0
 def test_sublist_in_middle(self):
     l1 = [2, 3, 4]
     l2 = [0, 1, 2, 3, 4, 5]
     self.assertEqual(SUBLIST, check_lists(l1, l2))
Exemplo n.º 9
0
 def test_sublist_at_end(self):
     l1 = [3, 4, 5]
     l2 = [0, 1, 2, 3, 4, 5]
     self.assertEqual(SUBLIST, check_lists(l1, l2))
Exemplo n.º 10
0
 def test_false_start(self):
     l1 = [1, 2, 5]
     l2 = [0, 1, 2, 3, 1, 2, 5, 6]
     self.assertEqual(SUBLIST, check_lists(l1, l2))
Exemplo n.º 11
0
 def test_consecutive(self):
     l1 = [1, 1, 2]
     l2 = [0, 1, 1, 1, 2, 1, 2]
     self.assertEqual(SUBLIST, check_lists(l1, l2))
Exemplo n.º 12
0
 def test_different_lists(self):
     l1 = list(range(1000000))
     l2 = list(range(1, 1000001))
     self.assertEqual(UNEQUAL, check_lists(l1, l2))
Exemplo n.º 13
0
 def test_equal_lists(self):
     l1 = [0, 1, 2]
     l2 = [0, 1, 2]
     self.assertEqual(EQUAL, check_lists(l1, l2))
Exemplo n.º 14
0
 def test_within_empty_list(self):
     self.assertEqual(SUPERLIST, check_lists([1], []))
Exemplo n.º 15
0
 def test_consecutive(self):
     self.assertEqual(
         check_lists([1, 1, 2], [0, 1, 1, 1, 2, 1, 2]),
         SUBLIST
     )
Exemplo n.º 16
0
 def test_in_middle_of_superlist(self):
     l1 = [0, 1, 2, 3, 4, 5]
     l2 = [2, 3]
     self.assertEqual(SUPERLIST, check_lists(l1, l2))
Exemplo n.º 17
0
 def test_sublist_at_end(self):
     self.assertEqual(
         check_lists([3, 4, 5], [0, 1, 2, 3, 4, 5]),
         SUBLIST
     )
Exemplo n.º 18
0
 def test_at_end_of_superlist(self):
     l1 = [0, 1, 2, 3, 4, 5]
     l2 = [3, 4, 5]
     self.assertEqual(SUPERLIST, check_lists(l1, l2))
Exemplo n.º 19
0
 def test_within_empty_list(self):
     self.assertEqual(SUPERLIST, check_lists([1], []))
Exemplo n.º 20
0
 def test_avoid_sets(self):
     self.assertEqual(UNEQUAL, check_lists([1, 3], [1, 2, 3]))
     self.assertEqual(UNEQUAL, check_lists([1, 2, 3], [1, 3]))
     self.assertEqual(UNEQUAL, check_lists([1, 2, 3], [3, 2, 1]))
Exemplo n.º 21
0
 def test_consecutive(self):
     l1 = [1, 1, 2]
     l2 = [0, 1, 1, 1, 2, 1, 2]
     self.assertEqual(SUBLIST, check_lists(l1, l2))
Exemplo n.º 22
0
 def test_empty_list_within(self):
     self.assertEqual(SUBLIST, check_lists([], [1, 2, 3]))
Exemplo n.º 23
0
 def test_empty_lists(self):
     self.assertEqual(EQUAL, check_lists([], []))
Exemplo n.º 24
0
 def test_different_lists(self):
     self.assertEqual(check_lists([1, 2, 3], [2, 3, 4]), UNEQUAL)
Exemplo n.º 25
0
 def test_avoid_sets(self):
     self.assertEqual(UNEQUAL, check_lists([1, 3], [1, 2, 3]))
     self.assertEqual(UNEQUAL, check_lists([1, 2, 3], [1, 3]))
     self.assertEqual(UNEQUAL, check_lists([1, 2, 3], [3, 2, 1]))
Exemplo n.º 26
0
 def test_false_start(self):
     self.assertEqual(check_lists([1, 2, 5], [0, 1, 2, 3, 1, 2, 5, 6]),
                      SUBLIST)
Exemplo n.º 27
0
 def test_empty_list_within_non_empty_list(self):
     self.assertEqual(
         check_lists([], [1, 2, 3]),
         SUBLIST
     )
Exemplo n.º 28
0
 def test_consecutive(self):
     self.assertEqual(check_lists([1, 1, 2], [0, 1, 1, 1, 2, 1, 2]),
                      SUBLIST)
Exemplo n.º 29
0
 def test_list_equals_itself(self):
     self.assertEqual(
         check_lists([1, 2, 3], [1, 2, 3]),
         EQUAL
     )
Exemplo n.º 30
0
 def test_sublist_in_middle(self):
     self.assertEqual(check_lists([2, 3, 4], [0, 1, 2, 3, 4, 5]), SUBLIST)
Exemplo n.º 31
0
 def test_false_start(self):
     self.assertEqual(
         check_lists([1, 2, 5], [0, 1, 2, 3, 1, 2, 5, 6]),
         SUBLIST
     )
Exemplo n.º 32
0
 def test_sublist_at_end(self):
     self.assertEqual(check_lists([3, 4, 5], [0, 1, 2, 3, 4, 5]), SUBLIST)
Exemplo n.º 33
0
 def test_sublist_in_middle(self):
     self.assertEqual(
         check_lists([2, 3, 4], [0, 1, 2, 3, 4, 5]),
         SUBLIST
     )
Exemplo n.º 34
0
 def test_in_middle_of_superlist(self):
     self.assertEqual(check_lists([0, 1, 2, 3, 4, 5], [2, 3]), SUPERLIST)
Exemplo n.º 35
0
 def test_in_middle_of_superlist(self):
     self.assertEqual(
         check_lists([0, 1, 2, 3, 4, 5], [2, 3]),
         SUPERLIST
     )
Exemplo n.º 36
0
 def test_at_end_of_superlist(self):
     self.assertEqual(check_lists([0, 1, 2, 3, 4, 5], [3, 4, 5]), SUPERLIST)
Exemplo n.º 37
0
 def test_second_list_missing_element_from_first_list(self):
     self.assertEqual(
         check_lists([1, 2, 3], [1, 3]),
         UNEQUAL
     )
Exemplo n.º 38
0
 def test_second_list_missing_element_from_first_list(self):
     self.assertEqual(check_lists([1, 2, 3], [1, 3]), UNEQUAL)
Exemplo n.º 39
0
 def test_equal_lists(self):
     l1 = [0, 1, 2]
     l2 = [0, 1, 2]
     self.assertEqual(EQUAL, check_lists(l1, l2))
Exemplo n.º 40
0
 def test_order_matters_to_a_list(self):
     self.assertEqual(
         check_lists([1, 2, 3], [3, 2, 1]),
         UNEQUAL
     )
Exemplo n.º 41
0
 def test_false_start(self):
     l1 = [1, 2, 5]
     l2 = [0, 1, 2, 3, 1, 2, 5, 6]
     self.assertEqual(SUBLIST, check_lists(l1, l2))
Exemplo n.º 42
0
 def test_same_digits_but_different_numbers(self):
     self.assertEqual(
         check_lists([1, 0, 1], [10, 1]),
         UNEQUAL
     )
Exemplo n.º 43
0
 def test_sublist_in_middle(self):
     l1 = [2, 3, 4]
     l2 = [0, 1, 2, 3, 4, 5]
     self.assertEqual(SUBLIST, check_lists(l1, l2))
Exemplo n.º 44
0
 def test_empty_lists(self):
     self.assertEqual(
         check_lists([], []),
         EQUAL
     )
Exemplo n.º 45
0
 def test_in_middle_of_superlist(self):
     l1 = [0, 1, 2, 3, 4, 5]
     l2 = [2, 3]
     self.assertEqual(SUPERLIST, check_lists(l1, l2))
Exemplo n.º 46
0
 def test_inner_spaces(self):
     self.assertEqual(
         check_lists(['a c'], ['a', 'c']),
         UNEQUAL
     )
Exemplo n.º 47
0
 def test_at_end_of_superlist(self):
     l1 = [0, 1, 2, 3, 4, 5]
     l2 = [3, 4, 5]
     self.assertEqual(SUPERLIST, check_lists(l1, l2))
Exemplo n.º 48
0
 def test_large_lists(self):
     l1 = list(range(1000)) * 1000 + list(range(1000, 1100))
     l2 = list(range(900, 1050))
     self.assertEqual(check_lists(l1, l2), SUPERLIST)
Exemplo n.º 49
0
 def test_spread_sublist(self):
     multiples_of_3 = list(range(3, 200, 3))
     multiples_of_15 = list(range(15, 200, 15))
     self.assertEqual(UNEQUAL,
                      check_lists(multiples_of_15, multiples_of_3))
Exemplo n.º 50
0
 def test_spread_sublist(self):
     multiples_of_3 = list(range(3, 200, 3))
     multiples_of_15 = list(range(15, 200, 15))
     self.assertEqual(check_lists(multiples_of_15, multiples_of_3), UNEQUAL)
Exemplo n.º 51
0
 def test_empty_list_within(self):
     self.assertEqual(SUBLIST, check_lists([], [1, 2, 3]))
Exemplo n.º 52
0
 def test_sublist_at_start(self):
     l1 = [0, 1, 2]
     l2 = [0, 1, 2, 3, 4, 5]
     self.assertEqual(check_lists(l1, l2), SUBLIST)