Skip to content

Commit

Permalink
Merge pull request #729 from ethereum/fix_for_nlohmann_json
Browse files Browse the repository at this point in the history
Update test "compiling standard JSON (invalid JSON)" to be nlohmann::json compatible
  • Loading branch information
aarlt authored May 6, 2024
2 parents 14cff58 + 840f3b1 commit 4ab32d8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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();
});

Expand Down

0 comments on commit 4ab32d8

Please sign in to comment.