use of com.oracle.truffle.api.strings.MutableTruffleString in project graal by oracle.
the class TStringAsManagedTest method testAll.
@Test
public void testAll() throws Exception {
forAllStrings(true, (a, array, codeRange, isValid, encoding, codepoints, byteIndices) -> {
TruffleString b = node.execute(a, encoding);
MutableTruffleString bMutable = nodeMutable.execute(a, encoding);
assertBytesEqual(bMutable, encoding, array);
if (a instanceof MutableTruffleString) {
((MutableTruffleString) a).writeByteUncached(0, (byte) 123, encoding);
}
assertBytesEqual(b, encoding, array);
Assert.assertFalse(b.isNative());
Assert.assertFalse(bMutable.isNative());
});
}
use of com.oracle.truffle.api.strings.MutableTruffleString in project graal by oracle.
the class TStringAsTruffleStringTest method testAll.
@Test
public void testAll() throws Exception {
forAllStrings(true, (a, array, codeRange, isValid, encoding, codepoints, byteIndices) -> {
TruffleString b = node.execute(a, encoding);
if (a instanceof MutableTruffleString) {
((MutableTruffleString) a).writeByteUncached(0, (byte) 123, encoding);
assertBytesEqual(b, encoding, array);
} else {
Assert.assertSame(a, b);
}
});
}
Aggregations