11package com .jnape .palatable .lambda .matchers ;
22
33import com .jnape .palatable .lambda .adt .Either ;
4+ import com .jnape .palatable .lambda .adt .hlist .Tuple2 ;
5+ import com .jnape .palatable .lambda .io .IO ;
6+ import com .jnape .palatable .lambda .monad .MonadRec ;
47import com .jnape .palatable .lambda .monad .transformer .builtin .StateT ;
58import org .junit .Test ;
69import testsupport .matchers .StateTMatcher ;
@@ -36,21 +39,23 @@ public void whenExecWithMatcher() {
3639 @ Test
3740 public void whenRunWithUsingTwoMatchers () {
3841 assertThat (stateT (Either .right (1 )),
39- whenRunWith (left ("0" ), isRightThat (equalTo (1 )), isRightThat (isLeftThat (equalTo ("0" )))));
42+ StateTMatcher .<Either <String , Integer >, Either <String , ?>, Integer , Either <String , Integer >, Either <String , Either <String , Integer >>, Either <String , Tuple2 <Integer , Either <String , Integer >>>>whenRunWith (left ("0" ),
43+ isRightThat (equalTo (1 )), isRightThat (isLeftThat (equalTo ("0" )))));
4044 }
4145
4246 @ Test
4347 public void whenRunWithUsingOneTupleMatcher () {
4448 assertThat (stateT (Either .right (1 )),
45- whenRunWith (left ("0" ), isRightThat (equalTo (tuple (1 , left ("0" ))))));
49+ StateTMatcher .<Either <String , Integer >, Either <String , ?>, Integer , Either <String , Integer >, Either <String , Either <String , Integer >>, Either <String , Tuple2 <Integer , Either <String , Integer >>>>whenRunWith (left ("0" ),
50+ isRightThat (equalTo (tuple (1 , left ("0" ))))));
4651 }
4752
4853 @ Test
4954 public void onlyRunsStateOnceWithTupleMatcher () {
5055 AtomicInteger count = new AtomicInteger (0 );
5156
5257 assertThat (StateT .gets (s -> io (count ::incrementAndGet )),
53- whenRunWith (0 , yieldsValue (equalTo (tuple (1 , 0 )))));
58+ StateTMatcher .< Integer , IO <?>, Integer , IO < Integer >, IO < Integer >, IO < Tuple2 < Integer , Integer >>> whenRunWith (0 , yieldsValue (equalTo (tuple (1 , 0 )))));
5459 assertEquals (1 , count .get ());
5560 }
5661}
0 commit comments