示例#1
0
def test_solution():
    assert solution.is_palindrome("racecar") == True
    assert solution.is_palindrome("a") == True
    assert solution.is_palindrome("racecars") == False
    assert solution.is_palindrome("lol") == True
    assert solution.is_palindrome("noon") == True
    assert solution.is_palindrome("at") == False
    assert solution.is_palindrome("shrek") == False
示例#2
0
 def test_is_palindrome_1(self):
     self.assertTrue(is_palindrome(1))
示例#3
0
 def test_is_palindrome_5(self):
     self.assertTrue(is_palindrome(906609))
示例#4
0
 def test_is_palindrome_4(self):
     self.assertFalse(is_palindrome(1201))
示例#5
0
 def test_is_palindrome_3(self):
     self.assertTrue(is_palindrome(12021))
示例#6
0
 def test_is_palindrome(self):
     self.assertEqual(solution.is_palindrome(self.palindrome_odd), True)
     self.assertEqual(solution.is_palindrome(self.palindrome_even), True)
     self.assertEqual(solution.is_palindrome(self.palindrome), False)