File tree Expand file tree Collapse file tree 2 files changed +21
-17
lines changed
modules/test-logger-f-core/shared/src/test Expand file tree Collapse file tree 2 files changed +21
-17
lines changed Original file line number Diff line number Diff line change 11package core_testing
22
3- import effectie .core ._
43import extras .testing .CompileTimeError
54import hedgehog ._
65import hedgehog .runner ._
7- import loggerf .core ._
8- import loggerf .core .syntax .all ._
9- import loggerf .logger .{CanLog , Slf4JLogger }
106
117/** @author Kevin Lee
128 * @since 2025-08-05
@@ -17,10 +13,6 @@ object LogWithoutCustomInstanceSpec extends Properties {
1713 example(" test compile time error" , testCompileTimeError)
1814 )
1915
20- implicit val canLog : CanLog = Slf4JLogger .slf4JCanLog(" test-can-log" )
21-
22- def foo [F [* ]: Fx : Log ](n : Int ): F [Int ] = Log [F ].log(Fx [F ].effectOf(n * 2 ))(n => info(n.toString))
23-
2416 @ SuppressWarnings (Array (" org.wartremover.warts.Equals" ))
2517 def testCompileTimeError : Result = {
2618 val expected =
@@ -70,9 +62,19 @@ object LogWithoutCustomInstanceSpec extends Properties {
7062
7163 val actual = CompileTimeError .from(
7264 """
65+ import effectie.core._
66+ import loggerf.core._
67+ import loggerf.core.syntax.all._
68+ import loggerf.logger.{CanLog, Slf4JLogger}
69+
7370 import effectie.instances.tries.fx._
7471 import scala.util.Try
7572
73+ implicit val canLog: CanLog = Slf4JLogger.slf4JCanLog("test-can-log")
74+
75+ def foo[F[*]: Fx: Log](n: Int): F[Int] = Log[F].log(Fx[F].effectOf(n * 2))(n => info(n.toString))
76+
77+
7678 foo[Try](1)
7779 """
7880 )
Original file line number Diff line number Diff line change 11package core_testing
22
3- import effectie .core ._
43import hedgehog ._
54import hedgehog .runner ._
6- import loggerf .core ._
7- import loggerf .core .syntax .all ._
8- import loggerf .logger .{CanLog , Slf4JLogger }
95
106/** @author Kevin Lee
117 * @since 2025-08-05
@@ -16,10 +12,6 @@ object LogWithoutCustomInstanceSpec extends Properties {
1612 example(" test compile time error" , testCompileTimeError)
1713 )
1814
19- implicit val canLog : CanLog = Slf4JLogger .slf4JCanLog(" test-can-log" )
20-
21- def foo [F [* ]: Fx : Log ](n : Int ): F [Int ] = Log [F ].log(Fx [F ].effectOf(n * 2 ))(n => info(n.toString))
22-
2315 @ SuppressWarnings (Array (" org.wartremover.warts.Equals" ))
2416 def testCompileTimeError : Result = {
2517 val expectedMessage =
@@ -66,9 +58,19 @@ object LogWithoutCustomInstanceSpec extends Properties {
6658
6759 val actual = typeCheckErrors(
6860 """
69- import effectie.instances.tries.fx._
61+ import effectie.core.*
62+ import loggerf.core.*
63+ import loggerf.core.syntax.all.*
64+ import loggerf.logger.{CanLog, Slf4JLogger}
65+
66+ import effectie.instances.tries.fx.given
7067 import scala.util.Try
7168
69+ given canLog: CanLog = Slf4JLogger.slf4JCanLog("test-can-log")
70+
71+ def foo[F[*]: Fx: Log](n: Int): F[Int] = Log[F].log(Fx[F].effectOf(n * 2))(n => info(n.toString))
72+
73+
7274 foo[Try](1)
7375 """
7476 )
You can’t perform that action at this time.
0 commit comments