Skip to content

Commit e0839e1

Browse files
committed
Merge in upstream changes to remove arbitrary wrapper
1 parent efd0bfb commit e0839e1

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

props-core/src/test/java/fj/data/properties/PriorityQueueProperties.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import fj.data.PriorityQueue;
99
import fj.data.Set;
1010
import fj.test.Arbitrary;
11+
import fj.test.Gen;
1112
import fj.test.Property;
1213
import fj.test.reflect.CheckParams;
1314
import fj.test.runner.PropertyTestRunner;
@@ -18,7 +19,6 @@
1819
import static fj.test.Arbitrary.arbAlphaNumString;
1920
import static fj.test.Arbitrary.arbInteger;
2021
import static fj.test.Arbitrary.arbSet;
21-
import static fj.test.Arbitrary.arbitrary;
2222
import static fj.test.Property.impliesBoolean;
2323
import static fj.test.Property.prop;
2424
import static fj.test.Property.property;
@@ -32,15 +32,15 @@
3232
@CheckParams(maxSize = 100)
3333
public class PriorityQueueProperties {
3434

35-
public static Arbitrary<PriorityQueue<Integer, String>> arbPriorityQueueIntegerString = arbUniqueQueue(arbAlphaNumString);
35+
public static Gen<PriorityQueue<Integer, String>> arbPriorityQueueIntegerString = arbUniqueQueue(arbAlphaNumString);
3636

37-
public static <A> Arbitrary<PriorityQueue<Integer, A>> arbUniqueQueue(Arbitrary<A> aa) {
38-
Arbitrary<Set<Integer>> as = arbSet(Ord.intOrd, arbInteger);
39-
Arbitrary<List<Integer>> ints = arbitrary(as.gen.map(si -> si.toList()));
40-
Arbitrary<List<P2<Integer, A>>> alp = arbitrary(
41-
ints.gen.bind(li -> aa.gen.map(s -> li.map(i -> P.p(i, s))))
37+
public static <A> Gen<PriorityQueue<Integer, A>> arbUniqueQueue(Gen<A> aa) {
38+
Gen<Set<Integer>> as = arbSet(Ord.intOrd, arbInteger);
39+
Gen<List<Integer>> ints = (as.map(si -> si.toList()));
40+
Gen<List<P2<Integer, A>>> alp = (
41+
ints.bind(li -> aa.map(s -> li.map(i -> P.p(i, s))))
4242
);
43-
return arbitrary(alp.gen.map(l -> PriorityQueue.<A>emptyInt().enqueue(l)));
43+
return (alp.map(l -> PriorityQueue.<A>emptyInt().enqueue(l)));
4444
}
4545

4646
Property empty() {
@@ -75,10 +75,10 @@ Property addTop() {
7575
}
7676

7777
Property sorted() {
78-
Arbitrary<Set<Integer>> as = arbSet(Ord.intOrd, arbInteger);
79-
Arbitrary<List<Integer>> ints = arbitrary(as.gen.map(si -> si.toList()));
80-
Arbitrary<List<P2<Integer, String>>> alp = arbitrary(
81-
ints.gen.bind(li -> arbAlphaNumString.gen.map(s -> li.map(i -> P.p(i, s))))
78+
Gen<Set<Integer>> as = arbSet(Ord.intOrd, arbInteger);
79+
Gen<List<Integer>> ints = (as.map(si -> si.toList()));
80+
Gen<List<P2<Integer, String>>> alp = (
81+
ints.bind(li -> arbAlphaNumString.map(s -> li.map(i -> P.p(i, s))))
8282
);
8383
return property(alp, list -> {
8484
PriorityQueue<Integer, String> q = PriorityQueue.<String>emptyInt().enqueue(list);

0 commit comments

Comments
 (0)