-
Notifications
You must be signed in to change notification settings - Fork 4.4k
/
test_str_diff.py
26 lines (19 loc) · 880 Bytes
/
test_str_diff.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import unittest
class TestFindDiff(unittest.TestCase):
def test_find_diff(self):
solution = Solution()
self.assertRaises(TypeError, solution.find_diff, None)
self.assertEqual(solution.find_diff('ab', 'aab'), 'a')
self.assertEqual(solution.find_diff('aab', 'ab'), 'a')
self.assertEqual(solution.find_diff('abcd', 'abcde'), 'e')
self.assertEqual(solution.find_diff('aaabbcdd', 'abdbacade'), 'e')
self.assertEqual(solution.find_diff_xor('ab', 'aab'), 'a')
self.assertEqual(solution.find_diff_xor('aab', 'ab'), 'a')
self.assertEqual(solution.find_diff_xor('abcd', 'abcde'), 'e')
self.assertEqual(solution.find_diff_xor('aaabbcdd', 'abdbacade'), 'e')
print('Success: test_find_diff')
def main():
test = TestFindDiff()
test.test_find_diff()
if __name__ == '__main__':
main()