moved some test cases
This commit is contained in:
parent
c503ff31c5
commit
12d878d24b
|
@ -1,2 +1,3 @@
|
|||
bin/
|
||||
src/pp/iloc/sample/
|
||||
.meta/
|
|
@ -7,3 +7,4 @@
|
|||
/BoppiTokens.tokens
|
||||
/BoppiVisitor.java
|
||||
/BoppiTokens.g4
|
||||
/.antlr
|
||||
|
|
|
@ -55,22 +55,6 @@ public class ConditionalTest {
|
|||
*/
|
||||
@Test
|
||||
public void basicPrograms() {
|
||||
BoppiTests.compileAndRunString("print(5*3)");
|
||||
assertThat(BoppiTests.log, is(empty()));
|
||||
assertThat(BoppiTests.out, is(arrayContaining("15")));
|
||||
|
||||
BoppiTests.compileAndRunString("print({var int x; x := 8; print(x)})");
|
||||
assertThat(BoppiTests.log, is(empty()));
|
||||
assertThat(BoppiTests.out, is(arrayContaining("8", "8")));
|
||||
|
||||
BoppiTests.compileAndRunString("print('T', 'e', 's', 't', '!')");
|
||||
assertThat(BoppiTests.log, is(empty()));
|
||||
assertThat(BoppiTests.out, is(arrayContaining("T", "e", "s", "t", "!")));
|
||||
|
||||
BoppiTests.compileAndRunString("var int x; var int y; x := 3*(y := 4); print(x,y)");
|
||||
assertThat(BoppiTests.log, is(empty()));
|
||||
assertThat(BoppiTests.out, is(arrayContaining("12", "4")));
|
||||
|
||||
BoppiTests.compileAndRunFile("basicProgram1.boppi", "1", "T");
|
||||
assertThat(BoppiTests.log, is(empty()));
|
||||
assertThat(BoppiTests.out, is(arrayContaining("T", "T")));
|
||||
|
|
|
@ -82,6 +82,14 @@ public class ExpressionTest {
|
|||
*/
|
||||
@Test
|
||||
public void correctExpressionGeneration() {
|
||||
BoppiTests.compileAndRunString("print(5*3)");
|
||||
assertThat(BoppiTests.log, is(empty()));
|
||||
assertThat(BoppiTests.out, is(arrayContaining("15")));
|
||||
|
||||
BoppiTests.compileAndRunString("print('T', 'e', 's', 't', '!')");
|
||||
assertThat(BoppiTests.log, is(empty()));
|
||||
assertThat(BoppiTests.out, is(arrayContaining("T", "e", "s", "t", "!")));
|
||||
|
||||
BoppiTests.compileAndRunFile("simpleExpression.boppi");
|
||||
assertThat(BoppiTests.log, is(empty()));
|
||||
assertThat(BoppiTests.out, is(arrayContaining("1", "1", "3", "A", "false")));
|
||||
|
|
|
@ -125,6 +125,14 @@ public class SimpleVariableTest {
|
|||
*/
|
||||
@Test
|
||||
public void correctVariableGeneration() {
|
||||
BoppiTests.compileAndRunString("print({var int x; x := 8; print(x)})");
|
||||
assertThat(BoppiTests.log, is(empty()));
|
||||
assertThat(BoppiTests.out, is(arrayContaining("8", "8")));
|
||||
|
||||
BoppiTests.compileAndRunString("var int x; var int y; x := 3*(y := 4); print(x,y)");
|
||||
assertThat(BoppiTests.log, is(empty()));
|
||||
assertThat(BoppiTests.out, is(arrayContaining("12", "4")));
|
||||
|
||||
BoppiTests.compileAndRunFile("simpleVariable.boppi");
|
||||
assertThat(BoppiTests.log, is(empty()));
|
||||
|
||||
|
|
Loading…
Reference in New Issue