From fa1fd6062bd2fe0f91effc84c32c1a68f708ecc8 Mon Sep 17 00:00:00 2001 From: Volker Berlin Date: Sat, 24 Mar 2018 17:36:26 +0100 Subject: [PATCH] Adapt the expected error message for node. --- .../inetsoftware/jwebassembly/runtime/RuntimeErrors.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/de/inetsoftware/jwebassembly/runtime/RuntimeErrors.java b/test/de/inetsoftware/jwebassembly/runtime/RuntimeErrors.java index d693f55..80e85c0 100644 --- a/test/de/inetsoftware/jwebassembly/runtime/RuntimeErrors.java +++ b/test/de/inetsoftware/jwebassembly/runtime/RuntimeErrors.java @@ -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 {