Why
We already have operator-level mutators (ROR, LOR, etc.), and require(...) condition negation is being tracked separately in #2998.
This issue tracks the assert(...) counterpart so the scopes stay small and reviewable.
Negating the full assert condition is useful for checking whether invariant-style assertions are meaningfully exercised by tests.
What
Add mutator ACN that negates the first assert condition argument:
assert(x > 0 && x < 10) -> assert(!(x > 0 && x < 10))
assert(msg.sender == owner) -> assert(!(msg.sender == owner))
Scope
This issue only covers assert(...) condition negation.
require(...) condition negation is covered in #2998
Notes
This is intentionally split from #2998, so require(...) and assert(...) condition negation can be reviewed in separate PRs.
Why
We already have operator-level mutators (
ROR,LOR, etc.), andrequire(...)condition negation is being tracked separately in #2998.This issue tracks the
assert(...)counterpart so the scopes stay small and reviewable.Negating the full
assertcondition is useful for checking whether invariant-style assertions are meaningfully exercised by tests.What
Add mutator
ACNthat negates the firstassertcondition argument:assert(x > 0 && x < 10)->assert(!(x > 0 && x < 10))assert(msg.sender == owner)->assert(!(msg.sender == owner))Scope
This issue only covers
assert(...)condition negation.require(...)condition negation is covered in #2998Notes
This is intentionally split from #2998, so
require(...)andassert(...)condition negation can be reviewed in separate PRs.