Skip to content

Commit a2e9e63

Browse files
committed
Add test (#421)
1 parent 01fb98a commit a2e9e63

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

metafacture-flux/src/test/java/org/metafacture/flux/FluxGrammarTest.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,18 @@ public void shouldReplaceJavaEscapeSequences()
8989
stdoutBuffer.toString());
9090
}
9191

92+
@Test(expected = RuntimeException.class)
93+
public void issue421_shouldThrowRuntimeExceptionWhenSemicolonIsMissing()
94+
throws RecognitionException, IOException {
95+
final String script = "\"test\"|print";
96+
try {
97+
FluxCompiler.compile(createInputStream(script), emptyMap());
98+
} catch (RuntimeException re) {
99+
assertEquals("mismatched input '<EOF>' expecting ';' in Flux", re.getMessage());
100+
throw re;
101+
}
102+
}
103+
92104
private ByteArrayInputStream createInputStream(String script) {
93105
return new ByteArrayInputStream(script.getBytes(StandardCharsets.UTF_8));
94106
}

0 commit comments

Comments
 (0)