File tree Expand file tree Collapse file tree 2 files changed +34
-1
lines changed
Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -179,7 +179,7 @@ public Stream<Character> f(final A a) {
179179 public static <A > Show <A > anyShow () {
180180 return new Show <A >(new F <A , Stream <Character >>() {
181181 public Stream <Character > f (final A a ) {
182- return Stream .fromString (a .toString ());
182+ return Stream .fromString (( a == null ) ? "null" : a .toString ());
183183 }
184184 });
185185 }
Original file line number Diff line number Diff line change 1+ package fj .data .test ;
2+
3+ import fj .F2 ;
4+ import fj .F3 ;
5+ import fj .data .List ;
6+ import fj .test .Arbitrary ;
7+ import fj .test .CheckResult ;
8+ import fj .test .Gen ;
9+ import fj .test .Property ;
10+ import org .junit .Test ;
11+
12+ import static fj .Function .compose ;
13+ import static fj .test .Arbitrary .*;
14+ import static fj .test .Arbitrary .arbLong ;
15+ import static fj .test .Coarbitrary .coarbInteger ;
16+ import static fj .test .Coarbitrary .coarbLong ;
17+ import static fj .test .Property .prop ;
18+ import static fj .test .Property .property ;
19+
20+ /**
21+ * Created by MarkPerry on 3/07/2014.
22+ */
23+ public class TestNull {
24+
25+ @ Test
26+ public void testShowNullParameters () {
27+ Property p = property (arbitrary (Gen .<Integer >value (null )), (Integer i ) -> {
28+ return prop (i != null );
29+ });
30+ CheckResult .summary .println (p .check ());
31+ }
32+
33+ }
You can’t perform that action at this time.
0 commit comments