Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix tests
Browse files Browse the repository at this point in the history
klkvr committed Jul 11, 2023
1 parent 4ad27c6 commit 7792fbb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions testdata/cheats/Json.t.sol
Original file line number Diff line number Diff line change
@@ -149,10 +149,10 @@ contract ParseJson is DSTest {
string memory jsonString =
'{"some_key_to_value": "some_value", "some_key_to_array": [1, 2, 3], "some_key_to_object": {"key1": "value1", "key2": 2}}';
string[] memory keys = cheats.parseJsonKeys(jsonString, "$");
assertEq(keys, ["some_key_to_value", "some_key_to_array", "some_key_to_object"]);
assertEq(abi.encode(keys), abi.encode(["some_key_to_value", "some_key_to_array", "some_key_to_object"]));

keys = cheats.parseJsonKeys(jsonString, ".some_key_to_object");
assertEq(keys, ["key1", "key2"]);
assertEq(abi.encode(keys), abi.encode(["key1", "key2"]));

cheats.expectRevert(
"You can only get keys for JSON-object. The key '.some_key_to_array' does not return an object"

0 comments on commit 7792fbb

Please sign in to comment.