Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add unittest #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tests/test_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,13 @@ def test_is_isomorphic(self):
self.assertFalse(is_isomorphic("foo", "bar"))
self.assertTrue(is_isomorphic("paper", "title"))

def test_isomorphic_edge_cases(self):
self.assertTrue(is_isomorphic("13", "42"))
self.assertFalse(is_isomorphic("aa", "ab"))
self.assertFalse(is_isomorphic("ab", "aa"))
self.assertTrue(is_isomorphic("paper", "title"))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Comments:
    • Duplicate assertion in 'test_isomorphic_edge_cases'. The case 'self.assertTrue(is_isomorphic("paper", "title"))' is repeated.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Comments:
    • The test case test_isomorphic_edge_cases has a redundant assertion. The case self.assertTrue(is_isomorphic("paper", "title")) is already tested in test_is_isomorphic.

self.assertFalse(is_isomorphic("ab", "cdcd"))


class TestLongestPalindromicSubsequence(unittest.TestCase):
def test_longest_palindromic_subsequence_is_correct(self):
Expand Down