Search code examples
blockchainsolidity

Solidity Compiling Command(foundry)


I was learning to run the test.sol.

I command forge test -m testFundUpdatesFundedDataStructure and I faced the error with unexpected argument '-m' found

  • How can I compile this?
  • Did I miss something?

My code was fine, and I think there's something wrong with the command.

However I've tried forge test, it did compile success.

Can anyone tell me what was going on?


Solution

  • Foundry has updated their CLI flags. So you no longer have -m or --match.

    Instead you're supposed to use --match-test or shorthand --mt to specify your test function regex. Here's the official documentation for more reference.