-
Notifications
You must be signed in to change notification settings - Fork 114
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
Quickcheck IntCharSet #663
Conversation
includes generator for IntCharSet; addresses #662
Sort-of obvious, but would be nasty if violated. Discovered in quickcheck property testing.
@regisd would you be able to add the corresponding dependency to the bazel setup? |
Yes it was trivial to do.
|
* @see IntCharSet | ||
*/ | ||
@RunWith(JUnitQuickcheck.class) | ||
public class IntCharSetProperties { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file doesn't contain define properties ; I think we should just name in IntCharSetQuickcheck.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, clash of terminology. The things that quickcheck tests are called properties there (because they are supposed to resemble logical properties that you write for all inputs), and they all declare @Property
. I can see how this is ambiguous wrt to Java properties, though. Happy with .*QuickCheck
.
commit 6835dda Author: Gerwin Klein <[email protected]> AuthorDate: Mon Dec 9 00:12:40 2019 +1030 Commit: Régis Décamps <[email protected]> CommitDate: Sun Dec 8 14:42:40 2019 +0100 Quickcheck (#663) * quickcheck/property tests for IntCharSet includes generator for IntCharSet; addresses #662 * add junit-quickcheck bazel dependencies * add junit-quickcheck pom dependencies * IntCharSet: add debug assertions on add/sub Sort-of obvious, but would be nasty if violated. Discovered in quickcheck property testing. Updated from target/jflex-parent-1.8.0-SNAPSHOT-sources.jar
Thanks for that. Looking at the commit, I got fairly close, but got the reference name |
Adds property-based tests for
IntCharSet
(see also #662).Seems to work really nicely, reasonably fast, fails pretty much immediately on any property misbehaviour. I even discovered a few more assertions that should be there for debugging.