File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed
props-core/src/test/java/fj/data
quickcheck/src/test/java/fj/data/test Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change 1+ package fj .data ;
2+
3+ import fj .Equal ;
4+ import fj .test .Gen ;
5+ import fj .test .Property ;
6+ import fj .test .reflect .CheckParams ;
7+ import fj .test .runner .PropertyTestRunner ;
8+ import org .junit .runner .RunWith ;
9+
10+ import static fj .test .Arbitrary .*;
11+ import static fj .test .Property .prop ;
12+ import static fj .test .Property .property ;
13+
14+ /**
15+ * Created by MarkPerry on 18/06/2015.
16+ */
17+ @ RunWith (PropertyTestRunner .class )
18+ @ CheckParams (maxSize = 10000 )
19+ public class StreamProperties {
20+
21+ public Property bindStackOverflow () {
22+ int max = 5000 ;
23+ return property (arbitrary (Gen .choose (1 , max )), (n ) -> {
24+ Stream <Integer > s1 = Stream .range (1 , n );
25+ Stream <Integer > s2 = s1 .bind (j -> Stream .single (j ));
26+ return prop (s1 .zip (s2 ).forall (p2 -> Equal .intEqual .eq (p2 ._1 (), p2 ._2 ())));
27+ });
28+ }
29+
30+ }
Original file line number Diff line number Diff line change 2020
2121public class TestCheck {
2222
23- @ Test (timeout =1000 /*ms*/ )
23+ @ Test (timeout =5000 /*ms*/ )
2424 public void testExceptionsThrownFromGeneratorsArePropagated () {
2525 Gen <Integer > failingGen = Gen .<Integer >value (0 ).map ((i ) -> {
2626 throw new RuntimeException ("test failure" );
You can’t perform that action at this time.
0 commit comments