use of com.oracle.truffle.api.test.TruffleExceptionTest.ThrowNode in project graal by oracle.
the class LegacyTruffleExceptionTest method testPolyglotStackTrace.
@Test
public void testPolyglotStackTrace() {
setupEnv(Context.create(), new ProxyLanguage() {
@Override
protected CallTarget parse(TruffleLanguage.ParsingRequest request) throws Exception {
ThrowNode throwNode = new ThrowNode((n) -> {
return new LegacyCatchableException("Test exception", n);
});
return new TestRootNode(languageInstance, "test", null, throwNode).getCallTarget();
}
});
assertFails(() -> context.eval(ProxyLanguage.ID, "Test"), PolyglotException.class, (pe) -> {
TruffleExceptionTest.verifyStackTrace(pe, "<proxyLanguage> test", "(org.graalvm.sdk/)?org.graalvm.polyglot.Context.eval");
});
}
Aggregations