forked from jahin07/compiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathParserTest.java
35 lines (27 loc) · 889 Bytes
/
ParserTest.java
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
package cop5556sp17;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import cop5556sp17.Parser.SyntaxException;
import cop5556sp17.Scanner.IllegalCharException;
import cop5556sp17.Scanner.IllegalNumberException;
public class ParserTest {
@Rule
public ExpectedException thrown = ExpectedException.none();
@Test
public void testFactor0() throws IllegalCharException, IllegalNumberException, SyntaxException {
String input = "abc";
Scanner scanner = new Scanner(input);
scanner.scan();
Parser parser = new Parser(scanner);
parser.factor();
}
@Test
public void testArg() throws IllegalCharException, IllegalNumberException, SyntaxException {
String input = " (3,5) ";
Scanner scanner = new Scanner(input);
scanner.scan();
Parser parser = new Parser(scanner);
parser.arg();
}
}