Skip to content

Commit

Permalink
Update test "compiling standard JSON (invalid JSON)" to be nlohmann::…
Browse files Browse the repository at this point in the history
…json compatible.
  • Loading branch information
aarlt committed Feb 26, 2024
1 parent 72d67e2 commit 8fc7d24
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/compiler.ts
Expand Up @@ -85,6 +85,10 @@ function runTests (solc, versionText) {
}
}
}
console.log('Expectation is not matching:');
console.log(`- output: ${JSON.stringify(output)}`);
console.log(`- errorType: ${errorType}`);
console.log(`- message: ${message}`);
return false;
}

Expand Down Expand Up @@ -751,7 +755,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', '[json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing object key - invalid literal; last read: \'{i\'; expected string literal')
);
st.end();
});

Expand Down

0 comments on commit 8fc7d24

Please sign in to comment.