How to make sure your assertions are thoroughly tested
withdrawalAmount
that adhere to the bounds set by the vm.assume()
constraints.
vm.assume()
to filter out invalid inputs that would cause the test to fail for reasons unrelated to your assertion logic.pcl
and running pcl test
for testing.
workflow_dispatch
FOUNDRY_PROFILE: assertions
pcl test
FOUNDRY_PROFILE: assertions
environment variable to ensure the correct Foundry profile is used for testing assertions.foundry.toml
file, which you should be familiar with if you have used Foundry before.
assertions
profile:
assertions/src
) - Keeps assertion code isolatedassertions/out
) - Prevents conflicts with main project artifactspcl test
or setting FOUNDRY_PROFILE=assertions
, Foundry uses this profile configuration instead of the default one.
You can set the FOUNDRY_PROFILE
environment variable to assertions
in your CI/CD workflow.
Or can specify the profile to use when running tests like this: