Add test for Palindrome (#2993)

This commit is contained in:
Aldo Telese 2022-04-03 15:19:24 +02:00 committed by GitHub
parent 77bcd4daa3
commit 1b02b41fcc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,18 @@
package com.thealgorithms.strings;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
public class PalindromeTest {
@Test
public void palindrome() {
String input1 = "kayak";
String input2 = "kayaks";
Assertions.assertTrue(Palindrome.isPalindrome(input1));
Assertions.assertFalse(Palindrome.isPalindrome(input2));
Assertions.assertTrue(Palindrome.isPalindromeRecursion(input1));
Assertions.assertFalse(Palindrome.isPalindromeRecursion(input2));
Assertions.assertTrue(Palindrome.isPalindrome1(input1));
Assertions.assertFalse(Palindrome.isPalindrome1(input2));
}
}