-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIsMatchTest.java
More file actions
50 lines (44 loc) · 1.01 KB
/
IsMatchTest.java
File metadata and controls
50 lines (44 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import org.junit.Test;
public class IsMatchTest {
IsMatch solver = new IsMatch();
@Test
public void test1(){
String s = "aa";
String p = "a";
boolean res = solver.isMatch(s, p);
System.out.println(res);
// false
}
@Test
public void test2(){
String s = "aa";
String p = "a*";
boolean res = solver.isMatch(s, p);
System.out.println(res);
// true
}
@Test
public void test3(){
String s = "ab";
String p = ".*";
boolean res = solver.isMatch(s, p);
System.out.println(res);
// true
}
@Test
public void test4(){
String s = "aab";
String p = "c*a*b";
boolean res = solver.isMatch(s, p);
System.out.println(res);
// true
}
@Test
public void test5(){
String s = "mississippi";
String p = "mis*is*p*.";
boolean res = solver.isMatch(s, p);
System.out.println(res);
// false
}
}