Repository navigation
Expand file tree
/
Copy pathValidateHooksTest.java
More file actions
63 lines (58 loc) · 1.98 KB
/
Copy pathValidateHooksTest.java
File metadata and controls
63 lines (58 loc) · 1.98 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
51
52
53
54
55
56
57
58
59
60
61
62
63
import org.junit.Before;
import org.junit.Test;
import java.util.HashSet;
import java.util.Set;
import static org.junit.Assert.assertEquals;
public class ValidateHooksTest {
ValidateHooks exp = new ValidateHooks();
Set<String> one = new HashSet<String>();
Set<String> two = new HashSet<String>();
Set<String> three = new HashSet<String>();
Set<String> four = new HashSet<String>();
Set<String> five = new HashSet<String>();
Set<String> six = new HashSet<String>();
@Before
public void setUp() {
one.add("{{}}");
one.add("{}{}");
two.add("{x}x");
two.add("{xx}");
two.add("{}xx");
three.add("");
four.add("x{x{2}b}x");
four.add("x{x}{2b}x");
four.add("x{x}{2}bx");
four.add("x{}x{2b}x");
four.add("x{}x{2}bx");
five.add("{}{{}{}{}}{{}}");
five.add("{{}{}{}{}}{{}}");
five.add("{{{}{}{}}}{{}}");
five.add("{}{{}{{}}}{{}}");
five.add("{{}{{{}}}}{{}}");
five.add("{{}}{{}{}}{{}}");
five.add("{}{}{}{}{}{{}}");
five.add("{}{{{{}}}}{{}}");
five.add("{}{}{{}{}}{{}}");
five.add("{}{{{}{}}}{{}}");
five.add("{}{}{{{}}}{{}}");
five.add("{{{}{{}}}}{{}}");
five.add("{{}{{}{}}}{{}}");
five.add("{{{{}{}}}}{{}}");
five.add("{{}}{}{{}}{{}}");
five.add("{{}{}{{}}}{{}}");
five.add("{{}}{}{}{}{{}}");
five.add("{}{}{}{{}}{{}}");
five.add("{{}}{{{}}}{{}}");
six.add("{{}}");
six.add("{}{}");
}
@Test
public void validate() {
assertEquals(true,one.equals(exp.validate("{}}{}}")));
assertEquals(true,two.equals(exp.validate("{}x}x}")));
assertEquals(true,three.equals(exp.validate("{{{{{")));
assertEquals(true,four.equals(exp.validate("x{}x}{2}b}x")));
assertEquals(true,five.equals(exp.validate("{}}{}}{}{}{}}}}{{{{}}{")));
assertEquals(true,six.equals(exp.validate("}{}}{}}")));
}
}