Adapt the expected error message for node.

This commit is contained in:
Volker Berlin 2018-03-24 17:36:26 +01:00
parent 3ab57b3804
commit fa1fd6062b

View File

@ -55,7 +55,13 @@ public class RuntimeErrors {
@Test
public void longReturn() {
assertEquals( "TypeError: cannot pass i64 to or from JS", rule.evalWasm( script, "longReturn" ) );
String error = rule.evalWasm( script, "longReturn" );
int newlineIdx = error.indexOf( '\n' );
if( newlineIdx > 0 ) {
error = error.substring( 0, newlineIdx );
}
String expected = script == ScriptEngine.SpiderMonkey ? "TypeError: cannot pass i64 to or from JS" : "TypeError: invalid type";
assertEquals( expected, error );
}
static class TestClass {