Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
klkvr committed Aug 3, 2023
1 parent 01ab7e1 commit d4a10cd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions testdata/cheats/Json.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,10 @@ contract ParseJsonTest 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 = vm.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 = vm.parseJsonKeys(jsonString, ".some_key_to_object");
assertEq(keys, ["key1", "key2"]);
assertEq(abi.encode(keys), abi.encode(["key1", "key2"]));

vm.expectRevert("You can only get keys for JSON-object. The key '.some_key_to_array' does not return an object");
vm.parseJsonKeys(jsonString, ".some_key_to_array");
Expand Down

0 comments on commit d4a10cd

Please sign in to comment.