Skip to content

Commit

Permalink
Pseudo-Merge 6835dda Quickcheck (#663)
Browse files Browse the repository at this point in the history
commit 6835dda
Author:     Gerwin Klein <gerwin.klein@data61.csiro.au>
AuthorDate: Mon Dec 9 00:12:40 2019 +1030
Commit:     Régis Décamps <regisd@google.com>
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
  • Loading branch information
traviscibot committed Dec 8, 2019
1 parent 3ca3c87 commit 8a04c1d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions java/jflex/core/IntCharSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ private int indexOf(int c) {

/** Merges the given set into this one. */
public void add(IntCharSet set) {
if (DEBUG) {
assert invariants();
assert set.invariants();
assert this != set;
}
for (Interval interval : set.intervals) {
add(interval);
}
Expand Down Expand Up @@ -372,6 +377,7 @@ public void sub(IntCharSet set) {
// not asserting non-null, because we'll already get an exception and it confuses lgtm.com
assert set.invariants();
assert isSubSet(set, this);
assert set != this;
}

int i = 0; // index in this.intervals
Expand Down

0 comments on commit 8a04c1d

Please sign in to comment.