-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add vm.assertContains
with overloads (String, etc..)
#4859
Comments
Btw let me know if anything here is unclear. Hopefully pretty straight forward request 🙏 thanks y'all! Would make a PR myself but I don't have the time this week to dive into the Foundry repo. Hopefully soon. Been just shimming this thing into any test file that needs it via solidity import. |
@mds1 any updates on this feature request? been quite a while so i just figured I'd bump this. |
I think this would be a nice assert to have. though we probably want this as native cheatcode impl and not implemented in solidity itself. forge-std/Test.sol then could simply call |
vm.assertStringContains
vm.assertContains
with overloads (String, etc..)
Hi @zerosnacks, happy to tackle this issue :) |
Component
Forge
Describe the feature you would like
In the DS Test assertions there should be a
assertStringContains(string, string)
method for checking strings interpolation.Additional context
Since we are not deploying these contracts to the network, the gas costs of doing string contains is negligible. It's extremely useful in testing on-chain NFT data etc and straight forward enough to do with two for loops that convert to bytes.
I use this in my tests. It works for every situation I've thrown at it but I have not unit tested this method itself.
The text was updated successfully, but these errors were encountered: