diff --git a/core/src/test/scala/com/evolutiongaming/catshelper/LogSpec.scala b/core/src/test/scala/com/evolutiongaming/catshelper/LogSpec.scala index efeb5967..740fd081 100644 --- a/core/src/test/scala/com/evolutiongaming/catshelper/LogSpec.scala +++ b/core/src/test/scala/com/evolutiongaming/catshelper/LogSpec.scala @@ -120,6 +120,21 @@ class LogSpec extends AnyFunSuite with Matchers { )) } + test("preset MDC concatenates with in-place MDC") { + + val stateT = for { + log0 <- logOf("source") + log = log0.withMdc(Log.Mdc.Eager("preset" -> "value")) + _ <- log.info("info", Log.Mdc.Eager("info" -> "value")) + } yield {} + + val (state, _) = stateT.run(State(Nil)) + state shouldEqual State(List( + Action.Info("info", Log.Mdc.Eager("info" -> "value", "preset" -> "value")), + Action.OfStr("source") + )) + } + test("MDC cleanup") { val io = for {