1
+ """Test cases for the anagram module."""
2
+
1
3
import unittest
2
4
3
5
from src .anagram import are_anagrams_array , are_anagrams_dict , are_anagrams_sorting
4
6
5
7
6
8
class TestAnagramMethods (unittest .TestCase ):
9
+ """Test cases for the anagram module."""
10
+
7
11
def setUp (self ):
12
+ """Set up the test cases."""
8
13
self .test_cases = [
9
14
("listen" , "silent" , True ),
10
15
("triangle" , "integral" , True ),
@@ -16,6 +21,7 @@ def setUp(self):
16
21
]
17
22
18
23
def test_are_anagrams_sorting (self ):
24
+ """Test the are_anagrams_sorting function."""
19
25
for str1 , str2 , expected in self .test_cases :
20
26
with self .subTest (str1 = str1 , str2 = str2 ):
21
27
self .assertEqual (
@@ -25,6 +31,7 @@ def test_are_anagrams_sorting(self):
25
31
)
26
32
27
33
def test_are_anagrams_dict (self ):
34
+ """Test the are_anagrams_dict function."""
28
35
for str1 , str2 , expected in self .test_cases :
29
36
with self .subTest (str1 = str1 , str2 = str2 ):
30
37
self .assertEqual (
@@ -34,6 +41,7 @@ def test_are_anagrams_dict(self):
34
41
)
35
42
36
43
def test_are_anagrams_array (self ):
44
+ """Test the are_anagrams_array function."""
37
45
for str1 , str2 , expected in self .test_cases :
38
46
with self .subTest (str1 = str1 , str2 = str2 ):
39
47
self .assertEqual (
0 commit comments