use of org.ballerinalang.launcher.util.CompileResult in project ballerina by ballerina-lang.
the class InvalidSyntaxParserTest method testParseSemicolonMissingMainFunc.
@Test
public void testParseSemicolonMissingMainFunc() {
CompileResult result = BCompileUtil.compile("test-src/parser/semicolon-missing-func-negative.bal");
BAssertUtil.validateError(result, 0, "missing token ';' before 'return'", 5, 2);
}
use of org.ballerinalang.launcher.util.CompileResult in project ballerina by ballerina-lang.
the class InvalidSyntaxParserTest method testResourceWithReply.
@Test
public void testResourceWithReply() {
CompileResult result = BCompileUtil.compile("test-src/parser/resource-with-reply-negative.bal");
BAssertUtil.validateError(result, 0, "undefined symbol 'reply'", 6, 5);
}
use of org.ballerinalang.launcher.util.CompileResult in project ballerina by ballerina-lang.
the class InvalidSyntaxParserTest method testParseMainFuncWithoutName.
@Test
public void testParseMainFuncWithoutName() {
CompileResult result = BCompileUtil.compile("test-src/parser/func-without-name-negative.bal");
BAssertUtil.validateError(result, 0, "mismatched input '{'. expecting {'[', '|', Identifier}", 1, 30);
BAssertUtil.validateError(result, 1, "mismatched input ';'. expecting {'[', '|', Identifier}", 3, 10);
}
use of org.ballerinalang.launcher.util.CompileResult in project ballerina by ballerina-lang.
the class InvalidSyntaxParserTest method testParseMainFuncWithoutParams.
@Test
public void testParseMainFuncWithoutParams() {
CompileResult result = BCompileUtil.compile("test-src/parser/func-without-params-negative.bal");
BAssertUtil.validateError(result, 0, "invalid token '{'", 1, 15);
}
use of org.ballerinalang.launcher.util.CompileResult in project ballerina by ballerina-lang.
the class InvalidSyntaxParserTest method testParseIdentifierMissingMainFunc.
@Test
public void testParseIdentifierMissingMainFunc() {
CompileResult result = BCompileUtil.compile("test-src/parser/identifier-missing-func-negative.bal");
BAssertUtil.validateError(result, 0, "invalid token ';'", 3, 5);
}
Aggregations