Skip to content

feat(cheatcodes): read length of arbitrary array #8467

Open
@ivanzhelyazkov

Description

@ivanzhelyazkov

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (af97b2c 2024-07-18T00:22:15.301937000Z)

What command(s) is the bug in?

forge test

Operating System

macOS (Apple Silicon)

Describe the bug

sometime between the latest nightly version (18-07-2024) and this commit: 7bef9ca (abt 3 weeks ago) a change was pushed which breaks the current json parsing:
string memory path = "./test.json";
string memory json = vm.readFile(path);
testCase = parseTestCase(json, "testCase");
string[] memory testCaseString = vm.parseJsonStringArray(json, initialParseString);

now fails with:
[FAIL. Reason: expected string, found JSON object;]

note above code previously worked for a long time (maybe longer than 10 months)

To reproduce, please find attached test which breaks in this repo (along with 22 more after upgrading to latest foundry version):
https://github.com/bancorprotocol/carbon-contracts/blob/317e0e9f785b62b1e73a017c9fe6c38bf2e06d27/test/forge/VortexTestCaseParser.t.sol#L51

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions