Skip assertions
See original GitHub issueIn OpenZeppelin, we’re considering dropping some of our assert
s and changing them to require
(see here for some relevant discussion), changing the semantics of assert
to ‘shouldn’t ever fail unless the code is buggy’. Because of that, solidity-coverage
will report a line with partial coverage on each assert
.
Could the requirement of assert
failure being covered be dropped, or an option added to disable it (maybe with a huge error flag if the assertion ended up failing)? We’d hate to have our coverage figure drop because of a semantics difference.
Thank you for your time and awesome work!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Assert.Ignore - NUnit Docs
The Assert.Ignore method provides you with the ability to dynamically cause a test or suite to be ignored at runtime. It may be...
Read more >Disable assertions while testing - Stack Overflow
I want to test the contract of my API so if, for example, an object is created with some parameter to nil an...
Read more >unittest — Unit testing framework — Python 3.11.1 ...
Source code: Lib/unittest/__init__.py(If you are already familiar with the basic concepts of testing, you might want to skip to the list of assert...
Read more >How to skip the test cases/assertions if the preceding test case ...
Hi, If say for example, I have 4 test cases. If first works, second doesn't work I want it to skip third (which...
Read more >Disable assertions? - Google Groups
Disable assertions? 358 views. Skip to first unread message.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Happy to help.
And yes, SMTChecker is actually useful! Check out this presentation by Leonardo Alt. It uses
assert
statements to identify bugs in a contract.@PaulRBerg
Ah ok… I would lean towards making this change without a major version bump since no one thinks these should branch and it’s more like a bug.
Thanks for the SMT link - I didn’t realize these have a working application now.