|
8 | 8 | */
|
9 | 9 | package cryptator;
|
10 | 10 |
|
11 |
| -import static cryptator.TreeTest.testInorder; |
12 |
| -import static cryptator.TreeTest.testPostorder; |
13 |
| -import static cryptator.TreeTest.testPreorder; |
14 |
| - |
15 |
| -import org.junit.Test; |
16 |
| - |
17 | 11 | import cryptator.parser.CryptaParserException;
|
18 | 12 | import cryptator.parser.CryptaParserWrapper;
|
19 | 13 | import cryptator.specs.ICryptaNode;
|
| 14 | +import org.junit.Test; |
| 15 | + |
| 16 | +import static cryptator.TreeTest.*; |
20 | 17 |
|
21 | 18 | public class ParserTest {
|
22 | 19 |
|
@@ -125,6 +122,31 @@ public void testParserError7() throws CryptaParserException {
|
125 | 122 | parser.parse("[send + more] >= money");
|
126 | 123 | }
|
127 | 124 |
|
| 125 | + @Test(expected = CryptaParserException.class) |
| 126 | + public void testParserError8() throws CryptaParserException { |
| 127 | + parser.parse(" send more = money"); |
| 128 | + } |
| 129 | + |
| 130 | + @Test(expected = CryptaParserException.class) |
| 131 | + public void testParserError9() throws CryptaParserException { |
| 132 | + parser.parse(" send more = money"); |
| 133 | + } |
| 134 | + |
| 135 | + @Test(expected = CryptaParserException.class) |
| 136 | + public void testParserError10() { |
| 137 | + parser.parse("send+more='1000 1'"); |
| 138 | + } |
| 139 | + |
| 140 | + @Test(expected = CryptaParserException.class) |
| 141 | + public void testParserError11() { |
| 142 | + parser.parse("send+more=\"1000 1\""); |
| 143 | + } |
| 144 | + |
| 145 | + @Test(expected = CryptaParserException.class) |
| 146 | + public void testParserError12() { |
| 147 | + parser.parse("send + more = '1000' money"); |
| 148 | + } |
| 149 | + |
128 | 150 | @Test
|
129 | 151 | public void testParserAND() throws CryptaParserException {
|
130 | 152 | final ICryptaNode node = parser.parse("send+more=money; d+e>=y");
|
@@ -246,6 +268,16 @@ public void testParserIntegerError2() throws CryptaParserException {
|
246 | 268 | parser.parse("send + more >= money; 1 + '12a45' = 3");
|
247 | 269 | }
|
248 | 270 |
|
| 271 | + @Test(expected = CryptaParserException.class) |
| 272 | + public void testParserIntegerError3() throws CryptaParserException { |
| 273 | + parser.parse("1000 1= 2"); |
| 274 | + } |
| 275 | + |
| 276 | + @Test(expected = CryptaParserException.class) |
| 277 | + public void testParserIntegerError4() throws CryptaParserException { |
| 278 | + parser.parse("10aa00 1zx= 2"); |
| 279 | + } |
| 280 | + |
249 | 281 | @Test
|
250 | 282 | public void testParserANDsymbol() throws CryptaParserException {
|
251 | 283 | final ICryptaNode node = parser.parse("send+more=money && d+e>=y");
|
|
0 commit comments