You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suppose that you have an invariant campaign with a depth of 5 and the runs set to 2.
Now, take the following dummy invariant test:
function invariant_Foo() external {
console2.log("Hello World"):
assertTrue(true);
}
Running this test with -vvv prints the following text - a single log, although the total number of calls is 10 (2 * 5):
Running 1 test for test/Foo.t.sol:FooTest
[PASS] invariant_Foo() (runs: 2, calls: 10, reverts: 0)
Logs:
Hello World
Test result: ok. 1 passed; 0 failed; finished in 1.99ms
My questions are:
After which run are the logs shown? The 1st or the 2nd?
Similarly, at which depth are the logs shown? 1, 2, 3, 4, or 5?
Previous experience with invariants would incline me to believe that the answers are 2 and 5, respectively, i.e., Foundry prints the console logs at the end of the invariant campaign. But I am not sure.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Suppose that you have an invariant campaign with a
depth
of5
and theruns
set to 2.Now, take the following dummy invariant test:
Running this test with
-vvv
prints the following text - a single log, although the total number of calls is 10 (2 * 5):My questions are:
Previous experience with invariants would incline me to believe that the answers are 2 and 5, respectively, i.e., Foundry prints the console logs at the end of the invariant campaign. But I am not sure.
Beta Was this translation helpful? Give feedback.
All reactions