From e0fc94269698982d937b80ff5fd5b1ef8ef28cf4 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Wed, 3 Jun 2015 19:43:14 +1000 Subject: Change shrinking a bit, add more generators, fix some types, moved suchThat Shrinking is now done using a "ShrinkStrategy". It's pretty similar to what it used to be in the end, but instead of generating new ShrinkTrees yourself, you just generate smaller s, and the generator framework will re-call your strategy to shrink smaller elements. (So, essentially, ShrinkStrategy.shrink(T obj) returns an Iterator which then has smaller trees calculated from it.) Added some more generators. In particular: longs and doubles. Fixed some types, so now Generator.tuple(integer(), string()) will work. Yay! Move suchThat to Generator, so now integer().suchThat(x -> x < 10) will work instead of the old Generators.suchThat(x -> x < 10, integer()), which felt a bit weird. --- src/main/java/au/id/zancanaro/javacheck/junit/Properties.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java/au/id/zancanaro/javacheck/junit') diff --git a/src/main/java/au/id/zancanaro/javacheck/junit/Properties.java b/src/main/java/au/id/zancanaro/javacheck/junit/Properties.java index b1cb375..ab56374 100644 --- a/src/main/java/au/id/zancanaro/javacheck/junit/Properties.java +++ b/src/main/java/au/id/zancanaro/javacheck/junit/Properties.java @@ -1,8 +1,8 @@ package au.id.zancanaro.javacheck.junit; import au.id.zancanaro.javacheck.Generator; -import au.id.zancanaro.javacheck.ShrinkTree; import au.id.zancanaro.javacheck.ShrinkResult; +import au.id.zancanaro.javacheck.ShrinkTree; import au.id.zancanaro.javacheck.annotations.DataSource; import au.id.zancanaro.javacheck.annotations.Property; import au.id.zancanaro.javacheck.annotations.Seed; @@ -48,7 +48,7 @@ public class Properties extends BlockJUnit4ClassRunner { } Type type = field.getGenericType(); - ParameterizedType parameterizedType;; + ParameterizedType parameterizedType; if (type instanceof ParameterizedType) { parameterizedType = (ParameterizedType) type; if (parameterizedType.getRawType() instanceof Class) { -- cgit v1.2.3