|
3 | 3 | from algorithms.hash_table.ransom_note import can_construct, can_construct_2 |
4 | 4 |
|
5 | 5 | RANSOM_NOTE_TEST_CASES = [ |
6 | | - ("codinginterviewquestions", "aboincsdefoetingvqtniewonoregessnutins", True), |
7 | | - ("code", "coingd", False), |
8 | | - ("codinginterview", "vieewidingcodinter", True), |
9 | | - ("program", "programming", True), |
10 | | - ("me", "meme", True), |
11 | | - ("a", "b", False), |
12 | | - ("aa", "ab", False), |
13 | | - ("aa", "aab", True), |
| 6 | + ( |
| 7 | + "long_note_success", |
| 8 | + "codinginterviewquestions", |
| 9 | + "aboincsdefoetingvqtniewonoregessnutins", |
| 10 | + True, |
| 11 | + ), |
| 12 | + ("missing_letter", "code", "coingd", False), |
| 13 | + ("shuffled_letters", "codinginterview", "vieewidingcodinter", True), |
| 14 | + ("subset_of_magazine", "program", "programming", True), |
| 15 | + ("repeated_letters", "me", "meme", True), |
| 16 | + ("single_char_mismatch", "a", "b", False), |
| 17 | + ("insufficient_repeated_char", "aa", "ab", False), |
| 18 | + ("sufficient_repeated_char", "aa", "aab", True), |
| 19 | + ("empty_ransom_note", "", "abc", True), |
| 20 | + ("empty_magazine", "a", "", False), |
14 | 21 | ] |
15 | 22 |
|
16 | 23 |
|
17 | 24 | class RansomNoteTestCase(unittest.TestCase): |
18 | 25 | @parameterized.expand(RANSOM_NOTE_TEST_CASES) |
19 | | - def test_can_construct(self, ransom_note: str, magazine: str, expected: bool): |
| 26 | + def test_can_construct(self, _, ransom_note: str, magazine: str, expected: bool): |
20 | 27 | actual = can_construct(ransom_note, magazine) |
21 | 28 | self.assertEqual(expected, actual) |
22 | 29 |
|
23 | 30 | @parameterized.expand(RANSOM_NOTE_TEST_CASES) |
24 | | - def test_can_construct_2(self, ransom_note: str, magazine: str, expected: bool): |
| 31 | + def test_can_construct_2(self, _, ransom_note: str, magazine: str, expected: bool): |
25 | 32 | actual = can_construct_2(ransom_note, magazine) |
26 | 33 | self.assertEqual(expected, actual) |
27 | 34 |
|
|
0 commit comments