Skip to content

Commit 52b8f86

Browse files
committed
Add edge cases for null and empty string to improve coverage
1 parent d056191 commit 52b8f86

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/test/java/com/thealgorithms/strings/TwoPointerPalindromeTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ void testPalindrome() {
1111
assertTrue(TwoPointerPalindrome.isPalindrome("racecar"));
1212
assertTrue(TwoPointerPalindrome.isPalindrome("a"));
1313

14+
assertTrue(TwoPointerPalindrome.isPalindrome(null));
15+
assertTrue(TwoPointerPalindrome.isPalindrome(""));
16+
1417
assertFalse(TwoPointerPalindrome.isPalindrome("hello"));
1518
assertFalse(TwoPointerPalindrome.isPalindrome("world"));
1619
}

0 commit comments

Comments
 (0)