From edfce37bc21699042baf14ad6d172d3187fe530c Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Mon, 1 Jun 2015 10:38:08 +1000 Subject: Add @DataSource, allow printing of RoseTrees, other small changes to generators --- src/main/java/au/id/zancanaro/PropertyError.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/main/java/au/id/zancanaro/PropertyError.java') diff --git a/src/main/java/au/id/zancanaro/PropertyError.java b/src/main/java/au/id/zancanaro/PropertyError.java index b2fb589..a0ee6df 100644 --- a/src/main/java/au/id/zancanaro/PropertyError.java +++ b/src/main/java/au/id/zancanaro/PropertyError.java @@ -6,10 +6,14 @@ import java.util.Iterator; public class PropertyError extends AssertionError { public PropertyError(String methodName, long seed, ShrinkResult shrunk) { - super(String.format("%s(%s)\n\tSeed: %s\n%s", - methodName, join(", ", shrunk.args), - seed, - shrunk.thrown.getMessage())); + super(shrunk.thrown.getMessage() == null ? + String.format("%s(%s)\n\tSeed: %s", + methodName, join(", ", shrunk.args), + seed): + String.format("%s(%s)\n\tSeed: %s\n%s", + methodName, join(", ", shrunk.args), + seed, + shrunk.thrown.getMessage())); initCause(shrunk.thrown); } -- cgit v1.2.3