77import org .junit .Test ;
88import org .junit .runner .RunWith ;
99import testsupport .traits .ApplicativeLaws ;
10+ import testsupport .traits .BifunctorLaws ;
1011import testsupport .traits .FunctorLaws ;
1112
1213import static com .jnape .palatable .lambda .adt .choice .Choice5 .a ;
@@ -35,7 +36,7 @@ public void setUp() {
3536 e = e ('z' );
3637 }
3738
38- @ TestTraits ({FunctorLaws .class , ApplicativeLaws .class })
39+ @ TestTraits ({FunctorLaws .class , ApplicativeLaws .class , BifunctorLaws . class })
3940 public Subjects <Choice5 <String , Integer , Boolean , Character , Double >> testSubjects () {
4041 return subjects (Choice5 .a ("foo" ), Choice5 .b (1 ), Choice5 .c (true ), Choice5 .d ('a' ), Choice5 .e (2d ));
4142 }
@@ -48,13 +49,4 @@ public void convergeStaysInChoice() {
4849 assertEquals (Choice4 .d (4d ), d .converge (e -> Choice4 .b (e .toString ())));
4950 assertEquals (Choice4 .b ("z" ), e .converge (e -> Choice4 .b (e .toString ())));
5051 }
51-
52- @ Test
53- public void bifunctorProperties () {
54- assertEquals (a , a .biMap (d -> -d , Character ::toUpperCase ));
55- assertEquals (b , b .biMap (d -> -d , Character ::toUpperCase ));
56- assertEquals (c , c .biMap (d -> -d , Character ::toUpperCase ));
57- assertEquals (d (-4D ), d .biMap (d -> -d , Character ::toUpperCase ));
58- assertEquals (e ('Z' ), e .biMap (d -> -d , Character ::toUpperCase ));
59- }
6052}
0 commit comments