mirror of
https://github.com/TheAlgorithms/Java.git
synced 2026-03-13 08:40:43 +08:00
style: enable MethodName in CheckStyle (#5182)
enabled: MethodName in CheckStyle
This commit is contained in:
committed by
GitHub
parent
ea4dc15a24
commit
295e7436b1
@@ -8,55 +8,55 @@ class KMPSearchTest {
|
||||
|
||||
@Test
|
||||
// valid test case
|
||||
public void KMPSearchTestLast() {
|
||||
public void kmpSearchTestLast() {
|
||||
String txt = "ABABDABACDABABCABAB";
|
||||
String pat = "ABABCABAB";
|
||||
KMPSearch kmpSearch = new KMPSearch();
|
||||
int value = kmpSearch.KMPSearch(pat, txt);
|
||||
int value = kmpSearch.kmpSearch(pat, txt);
|
||||
System.out.println(value);
|
||||
assertEquals(value, 10);
|
||||
}
|
||||
|
||||
@Test
|
||||
// valid test case
|
||||
public void KMPSearchTestFront() {
|
||||
public void kmpSearchTestFront() {
|
||||
String txt = "AAAAABAAABA";
|
||||
String pat = "AAAA";
|
||||
KMPSearch kmpSearch = new KMPSearch();
|
||||
int value = kmpSearch.KMPSearch(pat, txt);
|
||||
int value = kmpSearch.kmpSearch(pat, txt);
|
||||
System.out.println(value);
|
||||
assertEquals(value, 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
// valid test case
|
||||
public void KMPSearchTestMiddle() {
|
||||
public void kmpSearchTestMiddle() {
|
||||
String txt = "AAACAAAAAC";
|
||||
String pat = "AAAA";
|
||||
KMPSearch kmpSearch = new KMPSearch();
|
||||
int value = kmpSearch.KMPSearch(pat, txt);
|
||||
int value = kmpSearch.kmpSearch(pat, txt);
|
||||
System.out.println(value);
|
||||
assertEquals(value, 4);
|
||||
}
|
||||
|
||||
@Test
|
||||
// valid test case
|
||||
public void KMPSearchTestNotFound() {
|
||||
public void kmpSearchTestNotFound() {
|
||||
String txt = "AAABAAAA";
|
||||
String pat = "AAAA";
|
||||
KMPSearch kmpSearch = new KMPSearch();
|
||||
int value = kmpSearch.KMPSearch(pat, txt);
|
||||
int value = kmpSearch.kmpSearch(pat, txt);
|
||||
System.out.println(value);
|
||||
assertEquals(value, 4);
|
||||
}
|
||||
|
||||
@Test
|
||||
// not valid test case
|
||||
public void KMPSearchTest4() {
|
||||
public void kmpSearchTest4() {
|
||||
String txt = "AABAAA";
|
||||
String pat = "AAAA";
|
||||
KMPSearch kmpSearch = new KMPSearch();
|
||||
int value = kmpSearch.KMPSearch(pat, txt);
|
||||
int value = kmpSearch.kmpSearch(pat, txt);
|
||||
System.out.println(value);
|
||||
assertEquals(value, -1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user