File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
src/test/java/com/thealgorithms/searches Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 11package com .thealgorithms .searches ;
22
33import static org .junit .jupiter .api .Assertions .assertEquals ;
4+
45import org .junit .jupiter .api .Test ;
56
67public class BoyerMooreTest {
@@ -34,22 +35,21 @@ public void testPatternAtEnd() {
3435 BoyerMoore bm = new BoyerMoore ("CDE" );
3536 String text = "ABCDEFGCDE" ;
3637 int index = bm .search (text );
37- assertEquals (2 , index );
38- }
39-
38+ assertEquals (7 , index );
39+ }
4040
4141 @ Test
4242 public void testEmptyPattern () {
4343 BoyerMoore bm = new BoyerMoore ("" );
4444 String text = "Hello world" ;
4545 int index = bm .search (text );
46- assertEquals (0 , index );
46+ assertEquals (0 , index );
4747 }
4848
4949 @ Test
5050 public void testStaticSearchMethod () {
51- int index = BoyerMoore .search ("ABCDEFGCDE" , "CDE" );
52- assertEquals (2 , index );
51+ String text = "ABCDEFGCDE" ;
52+ int index = BoyerMoore .search (text , "CDE" );
53+ assertEquals (7 , index );
5354 }
54-
5555}
You can’t perform that action at this time.
0 commit comments