Search in sources :

Example 91 with CompileResult

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);
}
Also used : CompileResult(org.ballerinalang.launcher.util.CompileResult) Test(org.testng.annotations.Test)

Example 92 with CompileResult

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);
}
Also used : CompileResult(org.ballerinalang.launcher.util.CompileResult) Test(org.testng.annotations.Test)

Example 93 with CompileResult

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);
}
Also used : CompileResult(org.ballerinalang.launcher.util.CompileResult) Test(org.testng.annotations.Test)

Example 94 with CompileResult

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);
}
Also used : CompileResult(org.ballerinalang.launcher.util.CompileResult) Test(org.testng.annotations.Test)

Example 95 with CompileResult

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);
}
Also used : CompileResult(org.ballerinalang.launcher.util.CompileResult) Test(org.testng.annotations.Test)

Aggregations

CompileResult (org.ballerinalang.launcher.util.CompileResult)291 Test (org.testng.annotations.Test)287 BValue (org.ballerinalang.model.values.BValue)60 PackageNode (org.ballerinalang.model.tree.PackageNode)16 BLangDocumentation (org.wso2.ballerinalang.compiler.tree.BLangDocumentation)14 BString (org.ballerinalang.model.values.BString)13 BInteger (org.ballerinalang.model.values.BInteger)12 Path (java.nio.file.Path)5 BLangVariable (org.wso2.ballerinalang.compiler.tree.BLangVariable)5 File (java.io.File)4 GrpcCmd (org.ballerinalang.protobuf.cmd.GrpcCmd)4 BStringArray (org.ballerinalang.model.values.BStringArray)3 BLangDeprecatedNode (org.wso2.ballerinalang.compiler.tree.BLangDeprecatedNode)3 BLangFunction (org.wso2.ballerinalang.compiler.tree.BLangFunction)3 BLangStruct (org.wso2.ballerinalang.compiler.tree.BLangStruct)3 BFloat (org.ballerinalang.model.values.BFloat)2 BIntArray (org.ballerinalang.model.values.BIntArray)2 BMap (org.ballerinalang.model.values.BMap)2 BeforeTest (org.testng.annotations.BeforeTest)2 BLangService (org.wso2.ballerinalang.compiler.tree.BLangService)2