From 840f3b1cb78f94206cd049d042480c31f337550d Mon Sep 17 00:00:00 2001 From: Alexander Arlt Date: Mon, 26 Feb 2024 16:32:27 +0100 Subject: [PATCH] Add nlohmann::json compatibility. --- test/compiler.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/compiler.ts b/test/compiler.ts index e05185c1..c273f88a 100644 --- a/test/compiler.ts +++ b/test/compiler.ts @@ -76,7 +76,7 @@ function runTests (solc, versionText) { const error = output.errors[errorIndex]; if (error.type === errorType) { if (message) { - if (error.message.match(message) !== null) { + if (error.message === message || error.message.match(message) !== null) { return true; } } else { @@ -751,7 +751,11 @@ function runTests (solc, versionText) { t.test('compiling standard JSON (invalid JSON)', function (st) { const output = JSON.parse(solc.compile('{invalid')); // TODO: change wrapper to output matching error - st.ok(expectError(output, 'JSONError', 'Line 1, Column 2\n Missing \'}\' or object member name') || expectError(output, 'JSONError', 'Invalid JSON supplied:')); + st.ok( + expectError(output, 'JSONError', 'Line 1, Column 2\n Missing \'}\' or object member name') || + expectError(output, 'JSONError', 'Invalid JSON supplied:') || + expectError(output, 'JSONError', 'parse error at line 1, column 2: syntax error while parsing object key - invalid literal; last read: \'{i\'; expected string literal') + ); st.end(); });