use of org.ballerinalang.model.values.BValue in project ballerina by ballerina-lang.
the class HasKey method execute.
public void execute(Context ctx) {
BMap<String, BValue> map = (BMap<String, BValue>) ctx.getRefArgument(0);
String key = ctx.getStringArgument(0);
ctx.setReturnValues(new BBoolean(map.hasKey(key)));
}
use of org.ballerinalang.model.values.BValue in project ballerina by ballerina-lang.
the class AssertTest method testAssertIntEquals.
@Test
public void testAssertIntEquals() {
BValue[] args = { new BInteger(3), new BInteger(5) };
BTestUtils.invoke(compileResult, "testAssertIntEquals", args);
}
use of org.ballerinalang.model.values.BValue in project ballerina by ballerina-lang.
the class AssertTest method testAssertTrue.
@Test
public void testAssertTrue() {
BValue[] args = { new BBoolean(true) };
BTestUtils.invoke(compileResult, "testAssertTrue", args);
}
use of org.ballerinalang.model.values.BValue in project ballerina by ballerina-lang.
the class AssertTest method testAssertFloatArrayEquals1.
@Test(expectedExceptions = BLangRuntimeException.class, expectedExceptionsMessageRegExp = ".*expected \\[1.1, 2.2, 3.3\\] but found \\[1.1, 2.2, 3.3, " + "4.4\\].*")
public void testAssertFloatArrayEquals1() {
BValue[] args = { new BInteger(1) };
BTestUtils.invoke(compileResult, "testAssertFloatArrayEquals", args);
}
use of org.ballerinalang.model.values.BValue in project ballerina by ballerina-lang.
the class AssertTest method testAssertStringArrayEquals0.
@Test
public void testAssertStringArrayEquals0() {
BValue[] args = { new BInteger(0) };
BTestUtils.invoke(compileResult, "testAssertStringArrayEquals", args);
}
Aggregations