Skip to content

Instantly share code, notes, and snippets.

@codekrolik
Created July 28, 2014 05:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codekrolik/24aaeb86085e4ae837c5 to your computer and use it in GitHub Desktop.
Save codekrolik/24aaeb86085e4ae837c5 to your computer and use it in GitHub Desktop.
Tests for LongestPalindromeSubcsting
import org.junit.Test;
import static org.junit.Assert.*;
public class PalindromeSubstringTest {
@Test
public void testPalindrome() {
String s1 = "арозаупаланалапуазора";
assertEquals("арозаупаланалапуазора", PalindromeSubstring.getLongestPalindrome(s1));
String s2 = "чтотебенадомальчикэтоядяддядя";
assertEquals("ядяддядя", PalindromeSubstring.getLongestPalindrome(s2));
String s3 = "тебяфенязовутнетянефеняактотытогда";
assertEquals("янефеня", PalindromeSubstring.getLongestPalindrome(s3));
String s4 = "влесускрипелиромикикикимор";
assertEquals("ромикикикимор", PalindromeSubstring.getLongestPalindrome(s4));
String s5 = "киикгорныйбаран";
assertEquals("киик", PalindromeSubstring.getLongestPalindrome(s5));
String s6 = "ихибогмузыкиуегиптян";
assertEquals("ихи", PalindromeSubstring.getLongestPalindrome(s6));
String s7 = "а";
assertEquals("а", PalindromeSubstring.getLongestPalindrome(s7));
String s8 = "";
assertEquals("", PalindromeSubstring.getLongestPalindrome(s8));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment