|
@@ -4,5 +4,222 @@ import org.junit.Assert;
|
4
|
4
|
import org.junit.Test;
|
5
|
5
|
|
6
|
6
|
public class ParenCheckerTest {
|
|
7
|
+ ParenChecker parenChecker = new ParenChecker();
|
|
8
|
+
|
|
9
|
+ @Test
|
|
10
|
+ public void testParenFalse1(){
|
|
11
|
+ String words = "This is a ( sentence.";
|
|
12
|
+
|
|
13
|
+ boolean actual = parenChecker.parensPaired(words);
|
|
14
|
+
|
|
15
|
+ Assert.assertFalse(actual);
|
|
16
|
+ }
|
|
17
|
+
|
|
18
|
+ @Test
|
|
19
|
+ public void testParenFalse2(){
|
|
20
|
+ String words = "This is a ) sentence.";
|
|
21
|
+
|
|
22
|
+ boolean actual = parenChecker.parensPaired(words);
|
|
23
|
+
|
|
24
|
+ Assert.assertFalse(actual);
|
|
25
|
+ }
|
|
26
|
+
|
|
27
|
+ @Test
|
|
28
|
+ public void testParenFalse3(){
|
|
29
|
+ String words = "This is a )( sentence.";
|
|
30
|
+
|
|
31
|
+ boolean actual = parenChecker.parensPaired(words);
|
|
32
|
+
|
|
33
|
+ Assert.assertFalse(actual);
|
|
34
|
+ }
|
|
35
|
+
|
|
36
|
+ @Test
|
|
37
|
+ public void testParenTrue1(){
|
|
38
|
+ String words = "This is a () sentence.";
|
|
39
|
+
|
|
40
|
+ boolean actual = parenChecker.parensPaired(words);
|
|
41
|
+
|
|
42
|
+ Assert.assertTrue(actual);
|
|
43
|
+ }
|
|
44
|
+
|
|
45
|
+ @Test
|
|
46
|
+ public void testParenTrue2(){
|
|
47
|
+ String words = "This (is a) sentence.";
|
|
48
|
+
|
|
49
|
+ boolean actual = parenChecker.parensPaired(words);
|
|
50
|
+
|
|
51
|
+ Assert.assertTrue(actual);
|
|
52
|
+ }
|
|
53
|
+
|
|
54
|
+ @Test
|
|
55
|
+ public void testCurlyFalse1(){
|
|
56
|
+ String words = "This is a { sentence.";
|
|
57
|
+
|
|
58
|
+ boolean actual = parenChecker.curlyPaired(words);
|
|
59
|
+
|
|
60
|
+ Assert.assertFalse(actual);
|
|
61
|
+ }
|
|
62
|
+
|
|
63
|
+ @Test
|
|
64
|
+ public void testCurlyFalse2(){
|
|
65
|
+ String words = "This is a } sentence.";
|
|
66
|
+
|
|
67
|
+ boolean actual = parenChecker.curlyPaired(words);
|
|
68
|
+
|
|
69
|
+ Assert.assertFalse(actual);
|
|
70
|
+ }
|
|
71
|
+
|
|
72
|
+ @Test
|
|
73
|
+ public void testCurlyFalse3(){
|
|
74
|
+ String words = "This is a }{ sentence.";
|
|
75
|
+
|
|
76
|
+ boolean actual = parenChecker.curlyPaired(words);
|
|
77
|
+
|
|
78
|
+ Assert.assertFalse(actual);
|
|
79
|
+ }
|
|
80
|
+
|
|
81
|
+ @Test
|
|
82
|
+ public void testCurlyTrue1(){
|
|
83
|
+ String words = "This is a {} sentence.";
|
|
84
|
+
|
|
85
|
+ boolean actual = parenChecker.curlyPaired(words);
|
|
86
|
+
|
|
87
|
+ Assert.assertTrue(actual);
|
|
88
|
+ }
|
|
89
|
+
|
|
90
|
+ @Test
|
|
91
|
+ public void testCurlyTrue2(){
|
|
92
|
+ String words = "This {is a} sentence.";
|
|
93
|
+
|
|
94
|
+ boolean actual = parenChecker.curlyPaired(words);
|
|
95
|
+
|
|
96
|
+ Assert.assertTrue(actual);
|
|
97
|
+ }
|
|
98
|
+
|
|
99
|
+ @Test
|
|
100
|
+ public void testBracketFalse1(){
|
|
101
|
+ String words = "This is a [ sentence.";
|
|
102
|
+
|
|
103
|
+ boolean actual = parenChecker.bracePaired(words);
|
|
104
|
+
|
|
105
|
+ Assert.assertFalse(actual);
|
|
106
|
+ }
|
|
107
|
+
|
|
108
|
+ @Test
|
|
109
|
+ public void testBracketFalse2(){
|
|
110
|
+ String words = "This is a ] sentence.";
|
|
111
|
+
|
|
112
|
+ boolean actual = parenChecker.bracePaired(words);
|
|
113
|
+
|
|
114
|
+ Assert.assertFalse(actual);
|
|
115
|
+ }
|
|
116
|
+
|
|
117
|
+ @Test
|
|
118
|
+ public void testBracketFalse3(){
|
|
119
|
+ String words = "This is a ][ sentence.";
|
|
120
|
+
|
|
121
|
+ boolean actual = parenChecker.bracePaired(words);
|
|
122
|
+
|
|
123
|
+ Assert.assertFalse(actual);
|
|
124
|
+ }
|
|
125
|
+
|
|
126
|
+ @Test
|
|
127
|
+ public void testBracketTrue1(){
|
|
128
|
+ String words = "This is a [] sentence.";
|
|
129
|
+
|
|
130
|
+ boolean actual = parenChecker.bracePaired(words);
|
|
131
|
+
|
|
132
|
+ Assert.assertTrue(actual);
|
|
133
|
+ }
|
|
134
|
+
|
|
135
|
+ @Test
|
|
136
|
+ public void testBracketTrue2(){
|
|
137
|
+ String words = "This [is a] sentence.";
|
|
138
|
+
|
|
139
|
+ boolean actual = parenChecker.bracePaired(words);
|
|
140
|
+
|
|
141
|
+ Assert.assertTrue(actual);
|
|
142
|
+ }
|
|
143
|
+
|
|
144
|
+ @Test
|
|
145
|
+ public void testThingsFalse1(){
|
|
146
|
+ String words = "This is a < sentence.";
|
|
147
|
+
|
|
148
|
+ boolean actual = parenChecker.signsPaired(words);
|
|
149
|
+
|
|
150
|
+ Assert.assertFalse(actual);
|
|
151
|
+ }
|
|
152
|
+
|
|
153
|
+ @Test
|
|
154
|
+ public void testThingsFalse2(){
|
|
155
|
+ String words = "This is a > sentence.";
|
|
156
|
+
|
|
157
|
+ boolean actual = parenChecker.signsPaired(words);
|
|
158
|
+
|
|
159
|
+ Assert.assertFalse(actual);
|
|
160
|
+ }
|
|
161
|
+
|
|
162
|
+ @Test
|
|
163
|
+ public void testThingsFalse3(){
|
|
164
|
+ String words = "This is a >< sentence.";
|
|
165
|
+
|
|
166
|
+ boolean actual = parenChecker.signsPaired(words);
|
|
167
|
+
|
|
168
|
+ Assert.assertFalse(actual);
|
|
169
|
+ }
|
|
170
|
+
|
|
171
|
+ @Test
|
|
172
|
+ public void testThingsTrue1(){
|
|
173
|
+ String words = "This is a <> sentence.";
|
|
174
|
+
|
|
175
|
+ boolean actual = parenChecker.signsPaired(words);
|
|
176
|
+
|
|
177
|
+ Assert.assertTrue(actual);
|
|
178
|
+ }
|
|
179
|
+
|
|
180
|
+ @Test
|
|
181
|
+ public void testThingsTrue2(){
|
|
182
|
+ String words = "This is a <i> sentence.";
|
|
183
|
+
|
|
184
|
+ boolean actual = parenChecker.signsPaired(words);
|
|
185
|
+
|
|
186
|
+ Assert.assertTrue(actual);
|
|
187
|
+ }
|
|
188
|
+
|
|
189
|
+ @Test
|
|
190
|
+ public void testDoubleQuotesFalse(){
|
|
191
|
+ String words = "This is a \"sentence.";
|
|
192
|
+
|
|
193
|
+ boolean actual = parenChecker.doubleQuotePaired(words);
|
|
194
|
+
|
|
195
|
+ Assert.assertFalse(actual);
|
|
196
|
+ }
|
|
197
|
+
|
|
198
|
+ @Test
|
|
199
|
+ public void testDoubleQuotesTrue(){
|
|
200
|
+ String words = "This\" is a \"sentence.";
|
|
201
|
+
|
|
202
|
+ boolean actual = parenChecker.doubleQuotePaired(words);
|
|
203
|
+
|
|
204
|
+ Assert.assertTrue(actual);
|
|
205
|
+ }
|
|
206
|
+
|
|
207
|
+ @Test
|
|
208
|
+ public void testSingleQuotesFalse(){
|
|
209
|
+ String words = "This is a \'sentence.";
|
|
210
|
+
|
|
211
|
+ boolean actual = parenChecker.singleQuotePaired(words);
|
|
212
|
+
|
|
213
|
+ Assert.assertFalse(actual);
|
|
214
|
+ }
|
|
215
|
+
|
|
216
|
+ @Test
|
|
217
|
+ public void testSingleQuotesTrue(){
|
|
218
|
+ String words = "This\' is a \'sentence.";
|
|
219
|
+
|
|
220
|
+ boolean actual = parenChecker.singleQuotePaired(words);
|
|
221
|
+
|
|
222
|
+ Assert.assertTrue(actual);
|
|
223
|
+ }
|
7
|
224
|
|
8
|
225
|
}
|