@@ -20,30 +20,30 @@ import scala.util.Try
2020object fxSpec extends Properties {
2121 implicit private val errorLogger : ErrorLogger [Throwable ] = ErrorLogger .printlnDefaultErrorLogger
2222
23- override def tests : List [Test ] = futureSpecs
23+ override def tests : List [Test ] = futureSpecs(getClass.getName.stripSuffix( " $ " ))
2424
2525 /* Future */
26- val futureSpecs = List (
27- property(" test Fx[Future].effectOf" , FutureSpec .testEffectOf),
28- property(" test Fx[Future].fromEffect(effectOf)" , FutureSpec .testFromEffect),
29- property(" test Fx[Future].fromEffect(pureOf)" , FutureSpec .testFromEffectWithPure),
30- property(" test Fx[Future].pureOf" , FutureSpec .testPureOf),
31- property(" test Fx[Future].pureOrError(success case)" , FutureSpec .testPureOrErrorSuccessCase),
32- example(" test Fx[Future].pureOrError(error case)" , FutureSpec .testPureOrErrorErrorCase),
33- example(" test Fx[Future].unitOf" , FutureSpec .testUnitOf),
34- example(" test Fx[Future].errorOf" , FutureSpec .testErrorOf),
35- property(" test fx.pureOfOption[Future]" , FutureSpec .testPureOfOption),
36- property(" test fx.pureOfSome[Future]" , FutureSpec .testPureOfSome),
37- example(" test fx.pureOfNone[Future]" , FutureSpec .testPureOfNone),
38- property(" test fx.pureOfRight[Future]" , FutureSpec .testPureOfRight),
39- property(" test fx.pureOfLeft[Future]" , FutureSpec .testPureOfLeft),
40- property(" test Fx[Future].fromEither(Right)" , FutureSpec .testFromEitherRightCase),
41- property(" test Fx[Future].fromEither(Left)" , FutureSpec .testFromEitherLeftCase),
42- property(" test Fx[Future].fromOption(Some)" , FutureSpec .testFromOptionSomeCase),
43- property(" test Fx[Future].fromOption(None)" , FutureSpec .testFromOptionNoneCase),
44- property(" test Fx[Future].fromTry(Success)" , FutureSpec .testFromTrySuccessCase),
45- property(" test Fx[Future].fromTry(Failure)" , FutureSpec .testFromTryFailureCase),
46- property(" test Fx[Future].flatMapFa(Future[A])(A => IO[B])" , FutureSpec .testFlatMapFx),
26+ def futureSpecs ( name : String ) : List [ Test ] = List (
27+ property(s " from $name : test Fx[Future].effectOf" , FutureSpec .testEffectOf),
28+ property(s " from $name : test Fx[Future].fromEffect(effectOf)" , FutureSpec .testFromEffect),
29+ property(s " from $name : test Fx[Future].fromEffect(pureOf)" , FutureSpec .testFromEffectWithPure),
30+ property(s " from $name : test Fx[Future].pureOf" , FutureSpec .testPureOf),
31+ property(s " from $name : test Fx[Future].pureOrError(success case)" , FutureSpec .testPureOrErrorSuccessCase),
32+ example(s " from $name : test Fx[Future].pureOrError(error case)" , FutureSpec .testPureOrErrorErrorCase),
33+ example(s " from $name : test Fx[Future].unitOf" , FutureSpec .testUnitOf),
34+ example(s " from $name : test Fx[Future].errorOf" , FutureSpec .testErrorOf),
35+ property(s " from $name : test fx.pureOfOption[Future]" , FutureSpec .testPureOfOption),
36+ property(s " from $name : test fx.pureOfSome[Future]" , FutureSpec .testPureOfSome),
37+ example(s " from $name : test fx.pureOfNone[Future]" , FutureSpec .testPureOfNone),
38+ property(s " from $name : test fx.pureOfRight[Future]" , FutureSpec .testPureOfRight),
39+ property(s " from $name : test fx.pureOfLeft[Future]" , FutureSpec .testPureOfLeft),
40+ property(s " from $name : test Fx[Future].fromEither(Right)" , FutureSpec .testFromEitherRightCase),
41+ property(s " from $name : test Fx[Future].fromEither(Left)" , FutureSpec .testFromEitherLeftCase),
42+ property(s " from $name : test Fx[Future].fromOption(Some)" , FutureSpec .testFromOptionSomeCase),
43+ property(s " from $name : test Fx[Future].fromOption(None)" , FutureSpec .testFromOptionNoneCase),
44+ property(s " from $name : test Fx[Future].fromTry(Success)" , FutureSpec .testFromTrySuccessCase),
45+ property(s " from $name : test Fx[Future].fromTry(Failure)" , FutureSpec .testFromTryFailureCase),
46+ property(s " from $name : test Fx[Future].flatMapFa(Future[A])(A => IO[B])" , FutureSpec .testFlatMapFx),
4747 ) ++
4848 FutureSpec .testMonadLaws ++
4949 List (
@@ -280,17 +280,14 @@ object fxSpec extends Properties {
280280 ConcurrentSupport .newExecutionContext(executorService, ErrorLogger .printlnExecutionContextErrorLogger)
281281
282282 @ SuppressWarnings (Array (" org.wartremover.warts.Var" ))
283- var actual = before // scalafix:ok DisableSyntax.var
284- val testBefore = actual ==== before
285- val fromFuture = Fx [Future ].fromEffect(Fx [Future ].pureOf({ actual = after; () }))
286- val testAfterFrom = actual ==== before
287- // val testAfterFrom = actual ==== after
283+ var actual = before // scalafix:ok DisableSyntax.var
284+ val testBefore = actual ==== before
285+ val fromFuture = Fx [Future ].fromEffect(Fx [Future ].pureOf({ actual = after; () }))
288286 ConcurrentSupport .futureToValueAndTerminate(executorService, waitFor)(fromFuture)
289- val testAfterRun = actual ==== after
287+ val testAfterRun = actual ==== after
290288 Result .all(
291289 List (
292290 testBefore.log(" testBefore" ),
293- testAfterFrom.log(" testAfterFrom" ),
294291 testAfterRun.log(" testAfterRun" ),
295292 )
296293 )
0 commit comments