コード例 #1
0
def test_check_permutation():
    string1 = "test"
    string2 = "sett"
    assert check_permutation.check_permutation(string1, string2) is True
    string1 = "test"
    string2 = "sets"
    assert check_permutation.check_permutation(string1, string2) is False
    def test_check_permutation(self):
        result1 = check_permutation("penguin", "gepninu")
        result2 = check_permutation("trash", "can")

        self.assertEqual(result1, True)
        self.assertEqual(result2, False)
コード例 #3
0
 def test_both_empty_string(self):
     self.assertTrue(check_permutation("", ""))
コード例 #4
0
 def test_empty_string(self):
     self.assertFalse(check_permutation("", "Empty test"))
コード例 #5
0
 def test_permutation(self):
     self.assertTrue(check_permutation("Permutation", "rmtaontiPeu"))
コード例 #6
0
 def test_same_length_non_permutation(self):
     self.assertFalse(check_permutation("Hello", "World"))
コード例 #7
0
 def test_different_length_strings(self):
     self.assertFalse(check_permutation("Hey", "Hello you"))
コード例 #8
0
 def test_baseline(self):
     self.assertTrue(check_permutation.check_permutation("god", "dog"))
コード例 #9
0
 def test_complexWhitespaceTrue(self):
     self.assertTrue(
         check_permutation.check_permutation("hello world", "lll ooehrwd"))
コード例 #10
0
 def test_withWhitespace(self):
     self.assertFalse(
         check_permutation.check_permutation("hello world",
                                             "goodbye world"))
コード例 #11
0
 def test_lengthDiff(self):
     self.assertFalse(
         check_permutation.check_permutation("hello", "goodbye"))
def test_check_permutation():
    assert check_permutation("hello", "hello") is True
    assert check_permutation("hello", "olleh") is True
    assert check_permutation("hello", "holel") is True
    assert check_permutation("hello", "lehol") is True
    assert check_permutation("helo", "hello") is False
コード例 #13
0
def test_check_permutation():
    assert check_permutation('abc', 'cba') is True
    assert check_permutation('abc', 'dba') is False
    assert check_permutation('abcd', 'dba') is False
    assert check_permutation('ab', 'dba') is False
    assert check_permutation('', '') is True