use of org.ballerinalang.model.values.BString in project ballerina by ballerina-lang.
the class StringTest method testNullToLowerCase.
@Test(expectedExceptions = { BLangRuntimeException.class }, expectedExceptionsMessageRegExp = ".*error:.*NullReferenceException.*")
public void testNullToLowerCase() {
BValue[] args = { new BString(null) };
BRunUtil.invoke(result, "toLowerCase", args);
}
use of org.ballerinalang.model.values.BString in project ballerina by ballerina-lang.
the class StringTest method testNullToUpperCase.
@Test(expectedExceptions = { BLangRuntimeException.class }, expectedExceptionsMessageRegExp = ".*error:.*NullReferenceException.*")
public void testNullToUpperCase() {
BValue[] args = { new BString(null) };
BRunUtil.invoke(result, "toUpperCase", args);
}
use of org.ballerinalang.model.values.BString in project ballerina by ballerina-lang.
the class StringTest method testReplaceFirst.
@Test
public void testReplaceFirst() {
BValue[] args = { new BString("abc is not abc as abc anymore"), new BString("abc"), new BString("xyz") };
BValue[] returns = BRunUtil.invoke(result, "replaceFirst", args);
Assert.assertTrue(returns[0] instanceof BString);
Assert.assertEquals(returns[0].stringValue(), "xyz is not abc as abc anymore");
}
use of org.ballerinalang.model.values.BString in project ballerina by ballerina-lang.
the class StringTest method testReplaceFirstNull.
@Test(expectedExceptions = { BLangRuntimeException.class }, expectedExceptionsMessageRegExp = ".*error:.*NullReferenceException.*")
public void testReplaceFirstNull() {
BValue[] args = { new BString("abc is not abc as abc anymore"), new BString(null), new BString("xyz") };
BRunUtil.invoke(result, "replaceFirst", args);
}
use of org.ballerinalang.model.values.BString in project ballerina by ballerina-lang.
the class StringTest method testLastIndexOf.
@Test
public void testLastIndexOf() {
BValue[] args = { new BString("test x value x is x 18"), new BString("x") };
BRunUtil.invoke(result, "lastIndexOf", args);
}
Aggregations