diff options
author | Carlo Zancanaro <carlo@zancanaro.id.au> | 2015-11-24 12:57:27 +1100 |
---|---|---|
committer | Carlo Zancanaro <carlo@zancanaro.id.au> | 2015-11-24 12:57:27 +1100 |
commit | 8376ed30f83c9193025da5962de5f5d78edfa185 (patch) | |
tree | 6b79a0a9bdedce965d2905de2bc2a6ff10fbccc9 /src/test/java/au/id/zancanaro/javacheck/CollectionsTest.java | |
parent | 1b0565b1f6b4d5009da689ba5d486bce203e4905 (diff) |
Add an implicit generator for Sets
Diffstat (limited to 'src/test/java/au/id/zancanaro/javacheck/CollectionsTest.java')
-rw-r--r-- | src/test/java/au/id/zancanaro/javacheck/CollectionsTest.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/java/au/id/zancanaro/javacheck/CollectionsTest.java b/src/test/java/au/id/zancanaro/javacheck/CollectionsTest.java new file mode 100644 index 0000000..644e8a1 --- /dev/null +++ b/src/test/java/au/id/zancanaro/javacheck/CollectionsTest.java @@ -0,0 +1,23 @@ +package au.id.zancanaro.javacheck; + +import au.id.zancanaro.javacheck.annotations.Property; +import au.id.zancanaro.javacheck.junit.Properties; +import org.junit.runner.RunWith; + +import java.util.ArrayList; +import java.util.List; + +import static java.util.Collections.reverse; +import static org.junit.Assert.assertEquals; + +@RunWith(Properties.class) +public class CollectionsTest { + @Property + public void reverseIsInvolution(List<Integer> list) { + List<Integer> newList = new ArrayList<>(list); + reverse(newList); + reverse(newList); + + assertEquals(list, newList); + } +} |