Skip to content
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

Merged
merged 6 commits into from
Dec 8, 2019
Merged

Quickcheck IntCharSet #663

merged 6 commits into from
Dec 8, 2019

Conversation

lsf37
Copy link
Member

@lsf37 lsf37 commented Dec 8, 2019

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.

@lsf37 lsf37 added the testing Adding tests or test infrastructure. label Dec 8, 2019
includes generator for IntCharSet; addresses #662
Sort-of obvious, but would be nasty if violated. Discovered in quickcheck
property testing.
@lsf37
Copy link
Member Author

lsf37 commented Dec 8, 2019

@regisd would you be able to add the corresponding dependency to the bazel setup?

@regisd
Copy link
Member

regisd commented Dec 8, 2019

@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 {
Copy link
Member

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.

Copy link
Member Author

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.

@regisd regisd merged commit 6835dda into master Dec 8, 2019
@regisd regisd deleted the quickcheck branch December 8, 2019 13:42
@regisd regisd changed the title Quickcheck Quickcheck IntCharSet Dec 8, 2019
regisd pushed a commit that referenced this pull request Dec 8, 2019
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
@lsf37
Copy link
Member Author

lsf37 commented Dec 9, 2019

@regisd would you be able to add the corresponding dependency to the bazel setup?

Yes it was trivial to do.

Thanks for that. Looking at the commit, I got fairly close, but got the reference name com_pholser_... in the BUILD file wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Adding tests or test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants