|
1 |
| -import pytest |
2 |
| - |
| 1 | +import pytest |
| 2 | +from sequences.func import remove_duplicate_lists |
3 | 3 | import sequences
|
4 | 4 |
|
5 | 5 |
|
@@ -101,3 +101,35 @@ def test_is_vowel():
|
101 | 101 | assert sequences.is_vowel('A') is True
|
102 | 102 | assert sequences.is_vowel('1') is False
|
103 | 103 | assert sequences.is_vowel('@') is False
|
| 104 | + |
| 105 | + |
| 106 | +def test_remove_duplicate_lists(): |
| 107 | + # Test cases with duplicate lists |
| 108 | + input_list1 = [[1, 2, 3], [4, 5], [1, 2, 3], [6, 7]] |
| 109 | + expected_output1 = [[1, 2, 3], [4, 5], [6, 7]] |
| 110 | + |
| 111 | + input_list2 = [['a', 'b'], [1, 2], ['a', 'b'], ['c', 'd']] |
| 112 | + expected_output2 = [['a', 'b'], [1, 2], ['c', 'd']] |
| 113 | + |
| 114 | + # Test cases without duplicate lists |
| 115 | + input_list3 = [[1, 2], [3, 4], [5, 6]] |
| 116 | + expected_output3 = [[1, 2], [3, 4], [5, 6]] |
| 117 | + |
| 118 | + input_list4 = [['x', 'y'], ['z'], ['p', 'q'], ['r', 's']] |
| 119 | + expected_output4 = [['x', 'y'], ['z'], ['p', 'q'], ['r', 's']] |
| 120 | + |
| 121 | + # Test the function with the test cases |
| 122 | + assert remove_duplicate_lists(input_list1) == expected_output1 |
| 123 | + assert remove_duplicate_lists(input_list2) == expected_output2 |
| 124 | + assert remove_duplicate_lists(input_list3) == expected_output3 |
| 125 | + assert remove_duplicate_lists(input_list4) == expected_output4 |
| 126 | + |
| 127 | + # Test with an empty list |
| 128 | + assert remove_duplicate_lists([]) == [] |
| 129 | + |
| 130 | + # Test with a list containing a single empty sublist |
| 131 | + input_list5 = [[]] |
| 132 | + expected_output5 = [[]] |
| 133 | + assert remove_duplicate_lists(input_list5) == expected_output5 |
| 134 | + |
| 135 | +# You can add more test cases as needed |
0 commit comments