コード例 #1
0
 def test_one_away_change_char(self):
     string = "pale"
     string_perm = "bale"
     self.assertTrue(one_away(string, string_perm))
コード例 #2
0
 def test_one_away_reomve_two_char(self):
     string = "pale"
     string_perm = "pa"
     self.assertFalse(one_away(string, string_perm))
コード例 #3
0
 def test_one_away_add_char_diff_location(self):
     string = "pasle"
     string_perm = "pale"
     self.assertTrue(one_away(string, string_perm))
コード例 #4
0
 def test_one_away_add_two_char(self):
     string = "pale"
     string_perm = "paless"
     self.assertFalse(one_away(string, string_perm))
コード例 #5
0
 def test_one_away_add_char_diff_order(self):
     string = "pales"
     string_perm = "pale"
     self.assertTrue(one_away(string, string_perm))