diff --git a/chimney/src/test/scala-2/io/scalaland/chimney/VersionCompat.scala b/chimney/src/test/scala-2/io/scalaland/chimney/VersionCompat.scala index 516172ce7..7a6b71d29 100644 --- a/chimney/src/test/scala-2/io/scalaland/chimney/VersionCompat.scala +++ b/chimney/src/test/scala-2/io/scalaland/chimney/VersionCompat.scala @@ -5,12 +5,6 @@ import munit.internal.MacroCompatScala2 trait VersionCompat { - /* Directly used compileErrors from munit. - * For reasoning, see the Scala 3 version of the file. - */ - def compileErrorsFixed(code: String): String = - macro MacroCompatScala2.compileErrorsImpl - // TODO: I wish to remove these one day def compileErrorsScala2(code: String): String = diff --git a/chimney/src/test/scala-3/io/scalaland/chimney/PartialTransformerEnumSpec.scala b/chimney/src/test/scala-3/io/scalaland/chimney/PartialTransformerEnumSpec.scala index 5b596a4f7..f83539137 100644 --- a/chimney/src/test/scala-3/io/scalaland/chimney/PartialTransformerEnumSpec.scala +++ b/chimney/src/test/scala-3/io/scalaland/chimney/PartialTransformerEnumSpec.scala @@ -183,7 +183,7 @@ class PartialTransformerEnumSpec extends ChimneySpec { test( """should be absent by default and not allow transforming "superset" of case class to "subset" of case objects""" ) { - compileErrorsFixed("""(colors2enums.Color.Black: colors2enums.Color).transformIntoPartial[colors1enums.Color]""") + compileErrors("""(colors2enums.Color.Black: colors2enums.Color).transformIntoPartial[colors1enums.Color]""") .check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.colors2enums.Color to io.scalaland.chimney.fixtures.colors1enums.Color", "io.scalaland.chimney.fixtures.colors1enums.Color", @@ -396,7 +396,7 @@ class PartialTransformerEnumSpec extends ChimneySpec { } test("not allow transformation of of sealed hierarchies when the transformation would be ambiguous") { - val error = compileErrorsFixed( + val error = compileErrors( """ (shapes1enums.Shape.Triangle(shapes1enums.Point(0, 0), shapes1enums.Point(2, 2), shapes1enums.Point(2, 0)): shapes1enums.Shape) .transformIntoPartial[shapes5enums.Shape] @@ -604,7 +604,7 @@ class PartialTransformerEnumSpec extends ChimneySpec { test("should be disabled by default") { - compileErrorsFixed("(Foo.bar: Foo).transformIntoPartial[Bar]").check( + compileErrors("(Foo.bar: Foo).transformIntoPartial[Bar]").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.renames.Foo to io.scalaland.chimney.fixtures.renames.Bar", "io.scalaland.chimney.fixtures.renames.Bar", "derivation from bar: io.scalaland.chimney.fixtures.renames.Foo.bar to io.scalaland.chimney.fixtures.renames.Bar is not supported in Chimney!", @@ -613,7 +613,7 @@ class PartialTransformerEnumSpec extends ChimneySpec { "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("(Foo.bar: Foo).intoPartial[Bar].transform").check( + compileErrors("(Foo.bar: Foo).intoPartial[Bar].transform").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.renames.Foo to io.scalaland.chimney.fixtures.renames.Bar", "io.scalaland.chimney.fixtures.renames.Bar", "derivation from bar: io.scalaland.chimney.fixtures.renames.Foo.bar to io.scalaland.chimney.fixtures.renames.Bar is not supported in Chimney!", @@ -629,7 +629,7 @@ class PartialTransformerEnumSpec extends ChimneySpec { def namesMatch(fromName: String, toName: String): Boolean = fromName.equalsIgnoreCase(toName) } - compileErrorsFixed( + compileErrors( """(Foo.bar: Foo).intoPartial[Bar].enableCustomSubtypeNameComparison(BadNameComparison).transform""" ) .check( @@ -639,7 +639,7 @@ class PartialTransformerEnumSpec extends ChimneySpec { test("should inform user when the matcher they provided results in ambiguities") { - compileErrorsFixed( + compileErrors( """ (Foo.bar: Foo) .intoPartial[BarAmbiguous] @@ -682,7 +682,7 @@ class PartialTransformerEnumSpec extends ChimneySpec { @unused implicit val config = TransformerConfiguration.default .enableCustomSubtypeNameComparison(TransformedNamesComparison.CaseInsensitiveEquality) - compileErrorsFixed("(Foo.bar: Foo).intoPartial[Bar].disableCustomSubtypeNameComparison.transform").check( + compileErrors("(Foo.bar: Foo).intoPartial[Bar].disableCustomSubtypeNameComparison.transform").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.renames.Foo to io.scalaland.chimney.fixtures.renames.Bar", "io.scalaland.chimney.fixtures.renames.Bar", "derivation from bar: io.scalaland.chimney.fixtures.renames.Foo.bar to io.scalaland.chimney.fixtures.renames.Bar is not supported in Chimney!", diff --git a/chimney/src/test/scala-3/io/scalaland/chimney/TotalTransformerEnumSpec.scala b/chimney/src/test/scala-3/io/scalaland/chimney/TotalTransformerEnumSpec.scala index e291404b3..37bd7cf80 100644 --- a/chimney/src/test/scala-3/io/scalaland/chimney/TotalTransformerEnumSpec.scala +++ b/chimney/src/test/scala-3/io/scalaland/chimney/TotalTransformerEnumSpec.scala @@ -122,7 +122,7 @@ class TotalTransformerEnumSpec extends ChimneySpec { } test("not allow transformation of of sealed hierarchies when the transformation would be ambiguous") { - val error = compileErrorsFixed( + val error = compileErrors( """ (shapes1enums.Shape.Triangle(shapes1enums.Point(0, 0), shapes1enums.Point(2, 2), shapes1enums.Point(2, 0)): shapes1enums.Shape) .transformInto[shapes5enums.Shape] @@ -151,7 +151,7 @@ class TotalTransformerEnumSpec extends ChimneySpec { test( """should be absent by default and not allow transforming "superset" of case class to "subset" of case objects""" ) { - compileErrorsFixed("""(colors2enums.Color.Black: colors2enums.Color).transformInto[colors1enums.Color]""").check( + compileErrors("""(colors2enums.Color.Black: colors2enums.Color).transformInto[colors1enums.Color]""").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.colors2enums.Color to io.scalaland.chimney.fixtures.colors1enums.Color", "io.scalaland.chimney.fixtures.colors1enums.Color", "can't transform coproduct instance io.scalaland.chimney.fixtures.colors2enums.Color.Black to io.scalaland.chimney.fixtures.colors1enums.Color", @@ -317,7 +317,7 @@ class TotalTransformerEnumSpec extends ChimneySpec { test("should be disabled by default") { - compileErrorsFixed("(Foo.bar: Foo).transformInto[Bar]").check( + compileErrors("(Foo.bar: Foo).transformInto[Bar]").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.renames.Foo to io.scalaland.chimney.fixtures.renames.Bar", "io.scalaland.chimney.fixtures.renames.Bar", "derivation from bar: io.scalaland.chimney.fixtures.renames.Foo.bar to io.scalaland.chimney.fixtures.renames.Bar is not supported in Chimney!", @@ -326,7 +326,7 @@ class TotalTransformerEnumSpec extends ChimneySpec { "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("(Foo.bar: Foo).into[Bar].transform").check( + compileErrors("(Foo.bar: Foo).into[Bar].transform").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.renames.Foo to io.scalaland.chimney.fixtures.renames.Bar", "io.scalaland.chimney.fixtures.renames.Bar", "derivation from bar: io.scalaland.chimney.fixtures.renames.Foo.bar to io.scalaland.chimney.fixtures.renames.Bar is not supported in Chimney!", @@ -342,7 +342,7 @@ class TotalTransformerEnumSpec extends ChimneySpec { def namesMatch(fromName: String, toName: String): Boolean = fromName.equalsIgnoreCase(toName) } - compileErrorsFixed("""(Foo.bar: Foo).into[Bar].enableCustomSubtypeNameComparison(BadNameComparison).transform""") + compileErrors("""(Foo.bar: Foo).into[Bar].enableCustomSubtypeNameComparison(BadNameComparison).transform""") .check( "Invalid TransformerNamesComparison type - only (case) objects are allowed, and only the ones defined as top-level or in top-level objects, got: io.scalaland.chimney.TotalTransformerEnumSpec.BadNameComparison!!!" ) @@ -350,7 +350,7 @@ class TotalTransformerEnumSpec extends ChimneySpec { test("should inform user when the matcher they provided results in ambiguities") { - compileErrorsFixed( + compileErrors( """ (Foo.bar: Foo) .into[BarAmbiguous] @@ -392,7 +392,7 @@ class TotalTransformerEnumSpec extends ChimneySpec { @unused implicit val config = TransformerConfiguration.default .enableCustomSubtypeNameComparison(TransformedNamesComparison.CaseInsensitiveEquality) - compileErrorsFixed("(Foo.bar: Foo).into[Bar].disableCustomSubtypeNameComparison.transform").check( + compileErrors("(Foo.bar: Foo).into[Bar].disableCustomSubtypeNameComparison.transform").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.renames.Foo to io.scalaland.chimney.fixtures.renames.Bar", "io.scalaland.chimney.fixtures.renames.Bar", "derivation from bar: io.scalaland.chimney.fixtures.renames.Foo.bar to io.scalaland.chimney.fixtures.renames.Bar is not supported in Chimney!", diff --git a/chimney/src/test/scala-3/io/scalaland/chimney/VersionCompat.scala b/chimney/src/test/scala-3/io/scalaland/chimney/VersionCompat.scala index 02298b1d8..30b815bf1 100644 --- a/chimney/src/test/scala-3/io/scalaland/chimney/VersionCompat.scala +++ b/chimney/src/test/scala-3/io/scalaland/chimney/VersionCompat.scala @@ -2,26 +2,6 @@ package io.scalaland.chimney trait VersionCompat { - /* Copy/Paste from munit, with transparent keyword added. - * Without the keyword some unexpected error reports would be collected - */ - transparent inline def compileErrorsFixed(inline code: String): String = { - val errors = scala.compiletime.testing.typeCheckErrors(code) - errors - .map { error => - val indent = " " * (error.column - 1) - val trimMessage = error.message.linesIterator - .map { line => - if line.matches(" +") then "" - else line - } - .mkString("\n") - val separator = if error.message.contains('\n') then "\n" else " " - s"error:$separator$trimMessage\n${error.lineContent}\n$indent^" - } - .mkString("\n") - } - // TODO: I wish to remove these one day :/ transparent inline def compileErrorsScala2(inline code: String): String = "" diff --git a/chimney/src/test/scala/io/scalaland/chimney/IssuesSpec.scala b/chimney/src/test/scala/io/scalaland/chimney/IssuesSpec.scala index a5d1c580b..437eb03d1 100644 --- a/chimney/src/test/scala/io/scalaland/chimney/IssuesSpec.scala +++ b/chimney/src/test/scala/io/scalaland/chimney/IssuesSpec.scala @@ -66,7 +66,7 @@ class IssuesSpec extends ChimneySpec { test("fix for `withFieldConst`") { - compileErrorsFixed( + compileErrors( """ Foo1("test") .into[Foo2] @@ -77,7 +77,7 @@ class IssuesSpec extends ChimneySpec { test("fix for `withFieldComputed`") { - compileErrorsFixed( + compileErrors( """ Foo1("test") .into[Foo2] @@ -216,7 +216,7 @@ class IssuesSpec extends ChimneySpec { case class BarNested(num: String) @unused case class Bar(maybeString: scala.collection.immutable.Seq[String], nested: BarNested) - compileErrorsFixed("Foo(None, FooNested(None)).into[Bar].transform") + compileErrors("Foo(None, FooNested(None)).into[Bar].transform") .check( "derivation from foo.maybeString: scala.Option[scala.collection.immutable.Set[java.lang.String]] to scala.collection.immutable.Seq[java.lang.String] is not supported in Chimney!", "derivation from foo.nested.num: scala.Option[scala.Int] to java.lang.String is not supported in Chimney!" @@ -278,8 +278,8 @@ class IssuesSpec extends ChimneySpec { // These two will fail to compile as target is case class, but source type is internal.Venue, // thus it will try to access `def name` accessor without .enableMethodAccessors flag - compileErrorsFixed("event.venue.transformInto[dto.Venue]").arePresent() - compileErrorsFixed("(venue: internal.Venue).transformInto[dto.Venue]").arePresent() + compileErrors("event.venue.transformInto[dto.Venue]").arePresent() + compileErrors("(venue: internal.Venue).transformInto[dto.Venue]").arePresent() // When .enableMethodAccessors turned on, both should work fine event.venue.into[dto.Venue].enableMethodAccessors.transform ==> dto.Venue("Venue Name") @@ -711,7 +711,7 @@ class IssuesSpec extends ChimneySpec { case class Something(a: String, b: Int) } - compileErrorsFixed( + compileErrors( """ Proto(isSomething = true, somethingDetail = Some(Proto.SomethingDetail("hello", 1))) .intoPartial[Domain] diff --git a/chimney/src/test/scala/io/scalaland/chimney/PartialTransformerCustomConstructorSpec.scala b/chimney/src/test/scala/io/scalaland/chimney/PartialTransformerCustomConstructorSpec.scala index 80a1c5b6f..c93e08a3e 100644 --- a/chimney/src/test/scala/io/scalaland/chimney/PartialTransformerCustomConstructorSpec.scala +++ b/chimney/src/test/scala/io/scalaland/chimney/PartialTransformerCustomConstructorSpec.scala @@ -8,13 +8,13 @@ class PartialTransformerCustomConstructorSpec extends ChimneySpec { test("""not allow transformation when passed value is not a function/method""") { import products.{Foo, Bar} - compileErrorsFixed("""Foo(3, "pi", (3.14, 3.14)).intoPartial[Bar].withConstructor(Bar(4, (5.0, 5.0))).transform""") + compileErrors("""Foo(3, "pi", (3.14, 3.14)).intoPartial[Bar].withConstructor(Bar(4, (5.0, 5.0))).transform""") .check( "Expected function of any arity (scala.Function0, scala.Function1, scala.Function2, ...) that returns a value of ", // difference between Scala 2 and 3 ", got io.scalaland.chimney.fixtures.products.Bar" ) - compileErrorsFixed( + compileErrors( """Foo(3, "pi", (3.14, 3.14)).intoPartial[Bar].withConstructorPartial(partial.Result.fromValue(Bar(4, (5.0, 5.0)))).transform""" ).check( "Expected function of any arity (scala.Function0, scala.Function1, scala.Function2, ...) that returns a value of ", // difference between Scala 2 and 3 diff --git a/chimney/src/test/scala/io/scalaland/chimney/PartialTransformerDslSeparationSpec.scala b/chimney/src/test/scala/io/scalaland/chimney/PartialTransformerDslSeparationSpec.scala index 35d66ea21..6f2353463 100644 --- a/chimney/src/test/scala/io/scalaland/chimney/PartialTransformerDslSeparationSpec.scala +++ b/chimney/src/test/scala/io/scalaland/chimney/PartialTransformerDslSeparationSpec.scala @@ -43,7 +43,7 @@ class PartialTransformerDslSeparationSpec extends ChimneySpec { test("should not enable inlined derivation") { // format of missing method differ between 2 and 3 and we cannot rely on it - compileErrorsFixed("""Foo("test").intoPartial[Bar].transform""").arePresent() + compileErrors("""Foo("test").intoPartial[Bar].transform""").arePresent() } test("should not enable summoning declared instances") { @@ -51,7 +51,7 @@ class PartialTransformerDslSeparationSpec extends ChimneySpec { PartialTransformer.define[Foo, Bar].withFieldConst(_.baz, "test2").buildTransformer // format of missing method differ between 2 and 3 and we cannot rely on it - compileErrorsFixed("""Foo("test").transformIntoPartial[Bar]""").arePresent() + compileErrors("""Foo("test").transformIntoPartial[Bar]""").arePresent() } } @@ -63,7 +63,7 @@ class PartialTransformerDslSeparationSpec extends ChimneySpec { test("should not enable automatic derivation") { // format of missing implicit differ between 2 and 3 and we cannot rely on it - compileErrorsFixed("""Foo("test").transformIntoPartial[Bar]""").arePresent() + compileErrors("""Foo("test").transformIntoPartial[Bar]""").arePresent() } test("should enable inlined derivation") { @@ -75,7 +75,7 @@ class PartialTransformerDslSeparationSpec extends ChimneySpec { Transformer.define[Foo, Bar].withFieldConst(_.baz, "test2").buildTransformer // format of missing method differ between 2 and 3 and we cannot rely on it - compileErrorsFixed("""Foo("test").transformIntoPartial[Bar]""").arePresent() + compileErrors("""Foo("test").transformIntoPartial[Bar]""").arePresent() } } @@ -87,12 +87,12 @@ class PartialTransformerDslSeparationSpec extends ChimneySpec { test("should not enable automatic derivation") { // format of missing implicit differ between 2 and 3 and we cannot rely on it - compileErrorsFixed("""Foo("test").transformIntoPartial[Bar]""").arePresent() + compileErrors("""Foo("test").transformIntoPartial[Bar]""").arePresent() } test("should not enable inlined derivation") { // format of missing method differ between 2 and 3 and we cannot rely on it - compileErrorsFixed("""Foo("test").intoPartial[Bar].transform""").arePresent() + compileErrors("""Foo("test").intoPartial[Bar].transform""").arePresent() } test("should enable summoning declared instances") { diff --git a/chimney/src/test/scala/io/scalaland/chimney/PartialTransformerIntegrationsSpec.scala b/chimney/src/test/scala/io/scalaland/chimney/PartialTransformerIntegrationsSpec.scala index 89c055976..60af5bf24 100644 --- a/chimney/src/test/scala/io/scalaland/chimney/PartialTransformerIntegrationsSpec.scala +++ b/chimney/src/test/scala/io/scalaland/chimney/PartialTransformerIntegrationsSpec.scala @@ -695,13 +695,13 @@ class PartialTransformerIntegrationsSpec extends ChimneySpec { case class TargetWithOptionAndDefault(x: String, y: Possible[Int] = Possible.Present(42)) test("should be turned off by default and not allow compiling OptionalValue fields with missing source") { - compileErrorsFixed("""Source("foo").transformIntoPartial[TargetWithOption]""").check( + compileErrors("""Source("foo").transformIntoPartial[TargetWithOption]""").check( "Chimney can't derive transformation from io.scalaland.chimney.PartialTransformerIntegrationsSpec.Source to io.scalaland.chimney.PartialTransformerIntegrationsSpec.TargetWithOption", "io.scalaland.chimney.PartialTransformerIntegrationsSpec.TargetWithOption", "y: io.scalaland.chimney.TotalTransformerIntegrationsSpec.Possible[scala.Int] - no accessor named y in source type io.scalaland.chimney.PartialTransformerIntegrationsSpec.Source", "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("""Source("foo").intoPartial[TargetWithOption].transform""").check( + compileErrors("""Source("foo").intoPartial[TargetWithOption].transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.PartialTransformerIntegrationsSpec.Source to io.scalaland.chimney.PartialTransformerIntegrationsSpec.TargetWithOption", "io.scalaland.chimney.PartialTransformerIntegrationsSpec.TargetWithOption", "y: io.scalaland.chimney.TotalTransformerIntegrationsSpec.Possible[scala.Int] - no accessor named y in source type io.scalaland.chimney.PartialTransformerIntegrationsSpec.Source", @@ -765,7 +765,7 @@ class PartialTransformerIntegrationsSpec extends ChimneySpec { test("should disable globally enabled .enableOptionDefaultsToNone") { @unused implicit val config = TransformerConfiguration.default.enableOptionDefaultsToNone - compileErrorsFixed("""Source("foo").intoPartial[TargetWithOption].disableOptionDefaultsToNone.transform""").check( + compileErrors("""Source("foo").intoPartial[TargetWithOption].disableOptionDefaultsToNone.transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.PartialTransformerIntegrationsSpec.Source to io.scalaland.chimney.PartialTransformerIntegrationsSpec.TargetWithOption", "io.scalaland.chimney.PartialTransformerIntegrationsSpec.TargetWithOption", "y: io.scalaland.chimney.TotalTransformerIntegrationsSpec.Possible[scala.Int] - no accessor named y in source type io.scalaland.chimney.PartialTransformerIntegrationsSpec.Source", @@ -799,7 +799,7 @@ class PartialTransformerIntegrationsSpec extends ChimneySpec { @unused case class Target(a: String) test("should fail compilation if OptionalValue unwrapping is not provided when disabled") { - compileErrorsFixed( + compileErrors( """Source(Possible.Present("value")).intoPartial[Target].disablePartialUnwrapsOption.transform""" ).check( "Chimney can't derive transformation from io.scalaland.chimney.PartialTransformerIntegrationsSpec.Source to io.scalaland.chimney.PartialTransformerIntegrationsSpec.Target", @@ -812,7 +812,7 @@ class PartialTransformerIntegrationsSpec extends ChimneySpec { locally { @unused implicit val config = TransformerConfiguration.default.disablePartialUnwrapsOption - compileErrorsFixed("""Source(Possible.Present("value")).transformIntoPartial[Target]""").check( + compileErrors("""Source(Possible.Present("value")).transformIntoPartial[Target]""").check( "Chimney can't derive transformation from io.scalaland.chimney.PartialTransformerIntegrationsSpec.Source to io.scalaland.chimney.PartialTransformerIntegrationsSpec.Target", "java.lang.String", "derivation from source.a: io.scalaland.chimney.TotalTransformerIntegrationsSpec.Possible[java.lang.String] to java.lang.String is not supported in Chimney!", diff --git a/chimney/src/test/scala/io/scalaland/chimney/PartialTransformerJavaBeanSpec.scala b/chimney/src/test/scala/io/scalaland/chimney/PartialTransformerJavaBeanSpec.scala index bd98e6281..be935d41c 100644 --- a/chimney/src/test/scala/io/scalaland/chimney/PartialTransformerJavaBeanSpec.scala +++ b/chimney/src/test/scala/io/scalaland/chimney/PartialTransformerJavaBeanSpec.scala @@ -9,7 +9,7 @@ import scala.annotation.unused class PartialTransformerJavaBeanSpec extends ChimneySpec { test("automatic reading from Java Bean getters should be disabled by default") { - compileErrorsFixed( + compileErrors( """new JavaBeanSourceWithFlag(id = "test-id", name = "test-name", flag = true).intoPartial[CaseClassWithFlag].transform""" ).check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.javabeans.JavaBeanSourceWithFlag to io.scalaland.chimney.fixtures.javabeans.CaseClassWithFlag", @@ -22,7 +22,7 @@ class PartialTransformerJavaBeanSpec extends ChimneySpec { } test("automatic writing to Java Bean setters should be disabled by default") { - compileErrorsFixed("""CaseClassWithFlag("100", "name", flag = true).intoPartial[JavaBeanTarget].transform""").check( + compileErrors("""CaseClassWithFlag("100", "name", flag = true).intoPartial[JavaBeanTarget].transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.javabeans.CaseClassWithFlag to io.scalaland.chimney.fixtures.javabeans.JavaBeanTarget", "io.scalaland.chimney.fixtures.javabeans.JavaBeanTarget", "derivation from caseclasswithflag: io.scalaland.chimney.fixtures.javabeans.CaseClassWithFlag to io.scalaland.chimney.fixtures.javabeans.JavaBeanTarget is not supported in Chimney!", @@ -31,7 +31,7 @@ class PartialTransformerJavaBeanSpec extends ChimneySpec { } test("var vs setter ambiguities should be reported to the user") { - compileErrorsFixed( + compileErrors( """ new JavaBeanSourceWithAmbiguity("200", "name", flag = true).intoPartial[JavaBeanTarget] .enableBeanGetters @@ -161,7 +161,7 @@ class PartialTransformerJavaBeanSpec extends ChimneySpec { } test("should fail to compile when getter is not paired with the right setter") { - compileErrorsFixed( + compileErrors( """CaseClassWithFlagRenamed("test-id", "test-name", renamedFlag = true).intoPartial[JavaBeanTargetNoIdSetter].withFieldRenamed(_.id, _.getId).transform""" ).check( "Assumed that parameter/setter getId is a part of io.scalaland.chimney.fixtures.javabeans.JavaBeanTargetNoIdSetter, but wasn't found" @@ -194,7 +194,7 @@ class PartialTransformerJavaBeanSpec extends ChimneySpec { } test("not compile when matching an is- getter with type other than Boolean") { - compileErrorsFixed( + compileErrors( """ case class MistypedTarget(flag: Int) class MistypedSource(private var flag: Int) { @@ -209,7 +209,7 @@ class PartialTransformerJavaBeanSpec extends ChimneySpec { locally { @unused implicit val config = TransformerConfiguration.default.enableBeanGetters - compileErrorsFixed( + compileErrors( """ case class MistypedTarget(flag: Int) class MistypedSource(private var flag: Int) { @@ -229,7 +229,7 @@ class PartialTransformerJavaBeanSpec extends ChimneySpec { test("should disable globally enabled .enableBeanGetters") { @unused implicit val config = TransformerConfiguration.default.enableBeanGetters - compileErrorsFixed( + compileErrors( """ new JavaBeanSourceWithFlag(id = "test-id", name = "test-name", flag = true) .intoPartial[CaseClassWithFlag] @@ -269,7 +269,7 @@ class PartialTransformerJavaBeanSpec extends ChimneySpec { } test("should not compile when accessors are missing") { - compileErrorsFixed( + compileErrors( """ CaseClassNoFlag("100", "name") .intoPartial[JavaBeanTarget] @@ -283,7 +283,7 @@ class PartialTransformerJavaBeanSpec extends ChimneySpec { locally { @unused implicit val config = TransformerConfiguration.default.enableBeanSetters - compileErrorsFixed( + compileErrors( """ CaseClassNoFlag("100", "name") .intoPartial[JavaBeanTarget] @@ -297,7 +297,7 @@ class PartialTransformerJavaBeanSpec extends ChimneySpec { test("should not compile when method accessor is disabled") { - compileErrorsFixed( + compileErrors( """ CaseClassWithFlagMethod("100", "name") .intoPartial[JavaBeanTarget] @@ -315,7 +315,7 @@ class PartialTransformerJavaBeanSpec extends ChimneySpec { locally { @unused implicit val config = TransformerConfiguration.default.enableBeanSetters - compileErrorsFixed( + compileErrors( """ CaseClassWithFlagMethod("100", "name") .intoPartial[JavaBeanTarget] @@ -357,7 +357,7 @@ class PartialTransformerJavaBeanSpec extends ChimneySpec { test("should disable globally enabled .enableBeanSetters") { @unused implicit val config = TransformerConfiguration.default.enableBeanSetters - compileErrorsFixed( + compileErrors( """ CaseClassWithFlag("100", "name", flag = true) .intoPartial[JavaBeanTarget] @@ -376,7 +376,7 @@ class PartialTransformerJavaBeanSpec extends ChimneySpec { group("""flag .enableIgnoreUnmatchedBeanSetters""") { test("should be disabled by default") { - compileErrorsFixed("().transformIntoPartial[JavaBeanTarget]").check( + compileErrors("().transformIntoPartial[JavaBeanTarget]").check( "Chimney can't derive transformation from scala.Unit to io.scalaland.chimney.fixtures.javabeans.JavaBeanTarget", "io.scalaland.chimney.fixtures.javabeans.JavaBeanTarget", "setName(name: java.lang.String) - no accessor named name in source type scala.Unit", @@ -385,7 +385,7 @@ class PartialTransformerJavaBeanSpec extends ChimneySpec { "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("().intoPartial[JavaBeanTarget].transform").check( + compileErrors("().intoPartial[JavaBeanTarget].transform").check( "Chimney can't derive transformation from scala.Unit to io.scalaland.chimney.fixtures.javabeans.JavaBeanTarget", "io.scalaland.chimney.fixtures.javabeans.JavaBeanTarget", "setName(name: java.lang.String) - no accessor named name in source type scala.Unit", @@ -419,7 +419,7 @@ class PartialTransformerJavaBeanSpec extends ChimneySpec { expected.setId("100") expected.setName("name") - compileErrorsFixed( + compileErrors( """ CaseClassNoFlag("100", "name") .intoPartial[JavaBeanTarget] @@ -436,7 +436,7 @@ class PartialTransformerJavaBeanSpec extends ChimneySpec { locally { @unused implicit val config = TransformerConfiguration.default.enableIgnoreUnmatchedBeanSetters - compileErrorsFixed( + compileErrors( """ CaseClassNoFlag("100", "name") .intoPartial[JavaBeanTarget] @@ -480,7 +480,7 @@ class PartialTransformerJavaBeanSpec extends ChimneySpec { test("should disable globally enabled .enableIgnoreUnmatchedBeanSetters") { @unused implicit val config = TransformerConfiguration.default.enableIgnoreUnmatchedBeanSetters - compileErrorsFixed( + compileErrors( """ CaseClassWithFlag("100", "name", flag = true) .intoPartial[JavaBeanTarget] @@ -590,7 +590,7 @@ class PartialTransformerJavaBeanSpec extends ChimneySpec { test("should disable globally enabled .enableMethodAccessors") { @unused implicit val config = TransformerConfiguration.default.enableMethodAccessors - compileErrorsFixed( + compileErrors( """ CaseClassWithFlagMethod("100", "name") .intoPartial[JavaBeanTarget] @@ -619,9 +619,9 @@ class PartialTransformerJavaBeanSpec extends ChimneySpec { expected.setFlag(false) // need to enable both setters and getters; only one of them is not enough for this use case! - compileErrorsFixed("source.intoPartial[JavaBeanTarget].transform").arePresent() - compileErrorsFixed("source.intoPartial[JavaBeanTarget].enableBeanGetters.transform").arePresent() - compileErrorsFixed("source.intoPartial[JavaBeanTarget].enableBeanSetters.transform").arePresent() + compileErrors("source.intoPartial[JavaBeanTarget].transform").arePresent() + compileErrors("source.intoPartial[JavaBeanTarget].enableBeanGetters.transform").arePresent() + compileErrors("source.intoPartial[JavaBeanTarget].enableBeanSetters.transform").arePresent() source .intoPartial[JavaBeanTarget] diff --git a/chimney/src/test/scala/io/scalaland/chimney/PartialTransformerProductSpec.scala b/chimney/src/test/scala/io/scalaland/chimney/PartialTransformerProductSpec.scala index 226022784..166e7103b 100644 --- a/chimney/src/test/scala/io/scalaland/chimney/PartialTransformerProductSpec.scala +++ b/chimney/src/test/scala/io/scalaland/chimney/PartialTransformerProductSpec.scala @@ -30,14 +30,14 @@ class PartialTransformerProductSpec extends ChimneySpec { ) { import products.{Foo, Bar} - compileErrorsFixed("Bar(3, (3.14, 3.14)).intoPartial[Foo].transform").check( + compileErrors("Bar(3, (3.14, 3.14)).intoPartial[Foo].transform").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.products.Bar to io.scalaland.chimney.fixtures.products.Foo", "io.scalaland.chimney.fixtures.products.Foo", "y: java.lang.String - no accessor named y in source type io.scalaland.chimney.fixtures.products.Bar", "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("Bar(3, (3.14, 3.14)).transformIntoPartial[Foo]").check( + compileErrors("Bar(3, (3.14, 3.14)).transformIntoPartial[Foo]").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.products.Bar to io.scalaland.chimney.fixtures.products.Foo", "io.scalaland.chimney.fixtures.products.Foo", "y: java.lang.String - no accessor named y in source type io.scalaland.chimney.fixtures.products.Bar", @@ -88,30 +88,30 @@ class PartialTransformerProductSpec extends ChimneySpec { test("should not compile when selector is invalid") { import products.{Foo, Bar, HaveY} - compileErrorsFixed("""Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldConst(_.y + "abc", "pi").transform""").check( + compileErrors("""Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldConst(_.y + "abc", "pi").transform""").check( "The path expression has to be a single chain of calls on the original input, got operation other than value extraction:" ) - compileErrorsFixed( + compileErrors( """ val haveY = HaveY("") Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldConst(cc => haveY.y, "pi").transform """ ).check("The path expression has to be a single chain of calls on the original input, got external identifier:") - compileErrorsFixed("""Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldConst(_.matching, "pi").transform""") + compileErrors("""Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldConst(_.matching, "pi").transform""") .arePresent() - compileErrorsFixed("""Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldConst(_.matchingSome, "pi").transform""") + compileErrors("""Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldConst(_.matchingSome, "pi").transform""") .arePresent() - compileErrorsFixed("""Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldConst(_.matchingLeft, "pi").transform""") + compileErrors("""Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldConst(_.matchingLeft, "pi").transform""") .arePresent() - compileErrorsFixed("""Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldConst(_.matchingRight, "pi").transform""") + compileErrors("""Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldConst(_.matchingRight, "pi").transform""") .arePresent() - compileErrorsFixed("""Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldConst(_.everyItem, "pi").transform""") + compileErrors("""Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldConst(_.everyItem, "pi").transform""") .arePresent() - compileErrorsFixed("""Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldConst(_.everyMapKey, "pi").transform""") + compileErrors("""Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldConst(_.everyMapKey, "pi").transform""") .arePresent() - compileErrorsFixed("""Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldConst(_.everyMapValue, "pi").transform""") + compileErrors("""Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldConst(_.everyMapValue, "pi").transform""") .arePresent() } @@ -234,7 +234,7 @@ class PartialTransformerProductSpec extends ChimneySpec { test("should not compile when selector is invalid") { import products.{Foo, Bar, HaveY} - compileErrorsFixed( + compileErrors( """ Bar(3, (3.14, 3.14)) .intoPartial[Foo] @@ -245,7 +245,7 @@ class PartialTransformerProductSpec extends ChimneySpec { "The path expression has to be a single chain of calls on the original input, got operation other than value extraction:" ) - compileErrorsFixed( + compileErrors( """ val haveY = HaveY("") Bar(3, (3.14, 3.14)) @@ -255,23 +255,23 @@ class PartialTransformerProductSpec extends ChimneySpec { """ ).check("The path expression has to be a single chain of calls on the original input, got external identifier:") - compileErrorsFixed("""Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldConstPartial(_.matching, "pi").transform""") + compileErrors("""Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldConstPartial(_.matching, "pi").transform""") .arePresent() - compileErrorsFixed( + compileErrors( """Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldConstPartial(_.matchingSome, "pi").transform""" ).arePresent() - compileErrorsFixed( + compileErrors( """Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldConstPartial(_.matchingLeft, "pi").transform""" ).arePresent() - compileErrorsFixed( + compileErrors( """Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldConstPartial(_.matchingRight, "pi").transform""" ).arePresent() - compileErrorsFixed("""Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldConstPartial(_.everyItem, "pi").transform""") + compileErrors("""Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldConstPartial(_.everyItem, "pi").transform""") .arePresent() - compileErrorsFixed( + compileErrors( """Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldConstPartial(_.everyMapKey, "pi").transform""" ).arePresent() - compileErrorsFixed( + compileErrors( """Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldConstPartial(_.everyMapValue, "pi").transform""" ).arePresent() } @@ -415,7 +415,7 @@ class PartialTransformerProductSpec extends ChimneySpec { test("should not compile when selector is invalid") { import products.{Foo, Bar, HaveY} - compileErrorsFixed( + compileErrors( """ Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldComputed(_.y + "abc", _.toString).transform """ @@ -423,44 +423,44 @@ class PartialTransformerProductSpec extends ChimneySpec { "The path expression has to be a single chain of calls on the original input, got operation other than value extraction:" ) - compileErrorsFixed( + compileErrors( """ val haveY = HaveY("") Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldComputed(cc => haveY.y, _.toString).transform """ ).check("The path expression has to be a single chain of calls on the original input, got external identifier:") - compileErrorsFixed( + compileErrors( """ Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldComputed(_.matching, _.toString).transform """ ).arePresent() - compileErrorsFixed( + compileErrors( """ Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldComputed(_.matchingSome, _.toString).transform """ ).arePresent() - compileErrorsFixed( + compileErrors( """ Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldComputed(_.matchingLeft, _.toString).transform """ ).arePresent() - compileErrorsFixed( + compileErrors( """ Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldComputed(_.matchingRight, _.toString).transform """ ).arePresent() - compileErrorsFixed( + compileErrors( """ Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldComputed(_.everyItem, _.toString).transform """ ).arePresent() - compileErrorsFixed( + compileErrors( """ Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldComputed(_.everyMapKey, _.toString).transform """ ).arePresent() - compileErrorsFixed( + compileErrors( """ Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldComputed(_.everyMapValue, _.toString).transform """ @@ -596,7 +596,7 @@ class PartialTransformerProductSpec extends ChimneySpec { test("should not compile when selector is invalid") { import products.{Foo, Bar, HaveY} - compileErrorsFixed( + compileErrors( """ Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldComputedPartial(_.y + "abc", _ => ???).transform """ @@ -604,44 +604,44 @@ class PartialTransformerProductSpec extends ChimneySpec { "The path expression has to be a single chain of calls on the original input, got operation other than value extraction:" ) - compileErrorsFixed( + compileErrors( """ val haveY = HaveY("") Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldComputedPartial(cc => haveY.y, _ => ???).transform """ ).check("The path expression has to be a single chain of calls on the original input, got external identifier:") - compileErrorsFixed( + compileErrors( """ Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldComputedPartial(_.matching, _ => ???).transform """ ).arePresent() - compileErrorsFixed( + compileErrors( """ Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldComputedPartial(_.matchingSome, _ => ???).transform """ ).arePresent() - compileErrorsFixed( + compileErrors( """ Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldComputedPartial(_.matchingLeft, _ => ???).transform """ ).arePresent() - compileErrorsFixed( + compileErrors( """ Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldComputedPartial(_.matchingRight, _ => ???).transform """ ).arePresent() - compileErrorsFixed( + compileErrors( """ Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldComputedPartial(_.everyItem, _ => ???).transform """ ).arePresent() - compileErrorsFixed( + compileErrors( """ Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldComputedPartial(_.everyMapKey, _ => ???).transform """ ).arePresent() - compileErrorsFixed( + compileErrors( """ Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldComputedPartial(_.everyMapValue, _ => ???).transform """ @@ -792,7 +792,7 @@ class PartialTransformerProductSpec extends ChimneySpec { test("should not be enabled by default") { import products.Renames.* - compileErrorsFixed("""User(1, "Kuba", Some(28)).transformInto[UserPL]""").check( + compileErrors("""User(1, "Kuba", Some(28)).transformInto[UserPL]""").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.products.Renames.User to io.scalaland.chimney.fixtures.products.Renames.UserPL", "io.scalaland.chimney.fixtures.products.Renames.UserPL", "imie: java.lang.String - no accessor named imie in source type io.scalaland.chimney.fixtures.products.Renames.User", @@ -800,7 +800,7 @@ class PartialTransformerProductSpec extends ChimneySpec { "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("""User(1, "Kuba", Some(28)).into[UserPL].transform""").check( + compileErrors("""User(1, "Kuba", Some(28)).into[UserPL].transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.products.Renames.User to io.scalaland.chimney.fixtures.products.Renames.UserPL", "io.scalaland.chimney.fixtures.products.Renames.UserPL", "imie: java.lang.String - no accessor named imie in source type io.scalaland.chimney.fixtures.products.Renames.User", @@ -812,7 +812,7 @@ class PartialTransformerProductSpec extends ChimneySpec { test("should not compile when selector is invalid") { import products.Renames.* - compileErrorsFixed( + compileErrors( """ User(1, "Kuba", Some(28)).intoPartial[UserPL].withFieldRenamed(_.age + "ABC", _.toString).transform """ @@ -820,44 +820,44 @@ class PartialTransformerProductSpec extends ChimneySpec { "The path expression has to be a single chain of calls on the original input, got operation other than value extraction:" ) - compileErrorsFixed( + compileErrors( """ val str = "string" User(1, "Kuba", Some(28)).intoPartial[UserPL].withFieldRenamed(u => str, _.toString).transform """ ).check("The path expression has to be a single chain of calls on the original input, got external identifier:") - compileErrorsFixed( + compileErrors( """ Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldRenamed(_.matching, _.toString).transform """ ).arePresent() - compileErrorsFixed( + compileErrors( """ Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldRenamed(_.matchingSome, _.toString).transform """ ).arePresent() - compileErrorsFixed( + compileErrors( """ Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldRenamed(_.matchingLeft, _.toString).transform """ ).arePresent() - compileErrorsFixed( + compileErrors( """ Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldRenamed(_.matchingRight, _.toString).transform """ ).arePresent() - compileErrorsFixed( + compileErrors( """ Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldRenamed(_.everyItem, _.toString).transform """ ).arePresent() - compileErrorsFixed( + compileErrors( """ Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldRenamed(_.everyMapKey, _.toString).transform """ ).arePresent() - compileErrorsFixed( + compileErrors( """ Bar(3, (3.14, 3.14)).intoPartial[Foo].withFieldRenamed(_.everyMapValue, _.toString).transform """ @@ -963,7 +963,7 @@ class PartialTransformerProductSpec extends ChimneySpec { test("should not compile if renamed value change type but an there is no transformer available") { import products.Renames.* - compileErrorsFixed( + compileErrors( """ User(1, "Kuba", Some(28)) .intoPartial[UserPL] @@ -1040,7 +1040,7 @@ class PartialTransformerProductSpec extends ChimneySpec { test("should be disabled by default") { import products.Defaults.* - compileErrorsFixed("""Source(1, "yy", 1.0).transformIntoPartial[Target]""").check( + compileErrors("""Source(1, "yy", 1.0).transformIntoPartial[Target]""").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.products.Defaults.Source to io.scalaland.chimney.fixtures.products.Defaults.Target", "io.scalaland.chimney.fixtures.products.Defaults.Target", "x: scala.Int - no accessor named x in source type io.scalaland.chimney.fixtures.products.Defaults.Source", @@ -1048,7 +1048,7 @@ class PartialTransformerProductSpec extends ChimneySpec { "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("""Source(1, "yy", 1.0).intoPartial[Target].transform""").check( + compileErrors("""Source(1, "yy", 1.0).intoPartial[Target].transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.products.Defaults.Source to io.scalaland.chimney.fixtures.products.Defaults.Target", "io.scalaland.chimney.fixtures.products.Defaults.Target", "x: scala.Int - no accessor named x in source type io.scalaland.chimney.fixtures.products.Defaults.Source", @@ -1157,7 +1157,7 @@ class PartialTransformerProductSpec extends ChimneySpec { ) { import products.Defaults.* - compileErrorsFixed("""Source(1, "yy", 1.0).intoPartial[Target2].enableDefaultValues.transform""").check( + compileErrors("""Source(1, "yy", 1.0).intoPartial[Target2].enableDefaultValues.transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.products.Defaults.Source to io.scalaland.chimney.fixtures.products.Defaults.Target2", "io.scalaland.chimney.fixtures.products.Defaults.Target2", "xx: scala.Long - can't derive transformation from xx: scala.Int in source type io.scalaland.chimney.fixtures.products.Defaults.Source", @@ -1167,13 +1167,13 @@ class PartialTransformerProductSpec extends ChimneySpec { locally { @unused implicit val config = TransformerConfiguration.default.enableDefaultValues - compileErrorsFixed("""Source(1, "yy", 1.0).transformIntoPartial[Target2]""").check( + compileErrors("""Source(1, "yy", 1.0).transformIntoPartial[Target2]""").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.products.Defaults.Source to io.scalaland.chimney.fixtures.products.Defaults.Target2", "io.scalaland.chimney.fixtures.products.Defaults.Target2", "xx: scala.Long - can't derive transformation from xx: scala.Int in source type io.scalaland.chimney.fixtures.products.Defaults.Source", "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("""Source(1, "yy", 1.0).intoPartial[Target2].transform""").check( + compileErrors("""Source(1, "yy", 1.0).intoPartial[Target2].transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.products.Defaults.Source to io.scalaland.chimney.fixtures.products.Defaults.Target2", "io.scalaland.chimney.fixtures.products.Defaults.Target2", "xx: scala.Long - can't derive transformation from xx: scala.Int in source type io.scalaland.chimney.fixtures.products.Defaults.Source", @@ -1242,7 +1242,7 @@ class PartialTransformerProductSpec extends ChimneySpec { @unused implicit val config = TransformerConfiguration.default.enableDefaultValues - compileErrorsFixed("""Source(1, "yy", 1.0).intoPartial[Target].disableDefaultValues.transform""").check( + compileErrors("""Source(1, "yy", 1.0).intoPartial[Target].disableDefaultValues.transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.products.Defaults.Source to io.scalaland.chimney.fixtures.products.Defaults.Target", "io.scalaland.chimney.fixtures.products.Defaults.Target", "x: scala.Int - no accessor named x in source type io.scalaland.chimney.fixtures.products.Defaults.Source", @@ -1257,7 +1257,7 @@ class PartialTransformerProductSpec extends ChimneySpec { test("should be disabled by default") { import products.Inherited.* - compileErrorsFixed("(new Source).transformIntoPartial[Target]").check( + compileErrors("(new Source).transformIntoPartial[Target]").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.products.Inherited.Source to io.scalaland.chimney.fixtures.products.Inherited.Target", "io.scalaland.chimney.fixtures.products.Inherited.Target", "value: java.lang.String - no accessor named value in source type io.scalaland.chimney.fixtures.products.Inherited.Source", @@ -1265,7 +1265,7 @@ class PartialTransformerProductSpec extends ChimneySpec { "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("(new Source).intoPartial[Target].transform").check( + compileErrors("(new Source).intoPartial[Target].transform").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.products.Inherited.Source to io.scalaland.chimney.fixtures.products.Inherited.Target", "io.scalaland.chimney.fixtures.products.Inherited.Target", "value: java.lang.String - no accessor named value in source type io.scalaland.chimney.fixtures.products.Inherited.Source", @@ -1302,7 +1302,7 @@ class PartialTransformerProductSpec extends ChimneySpec { @unused implicit val cfg = TransformerConfiguration.default.enableInheritedAccessors - compileErrorsFixed("(new Source).intoPartial[Target].disableInheritedAccessors.transform").check( + compileErrors("(new Source).intoPartial[Target].disableInheritedAccessors.transform").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.products.Inherited.Source to io.scalaland.chimney.fixtures.products.Inherited.Target", "io.scalaland.chimney.fixtures.products.Inherited.Target", "value: java.lang.String - no accessor named value in source type io.scalaland.chimney.fixtures.products.Inherited.Source", @@ -1317,7 +1317,7 @@ class PartialTransformerProductSpec extends ChimneySpec { test("should be disabled by default") { import products.Accessors.* - compileErrorsFixed("Source(10).transformIntoPartial[Target2]").check( + compileErrors("Source(10).transformIntoPartial[Target2]").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.products.Accessors.Source to io.scalaland.chimney.fixtures.products.Accessors.Target2", "io.scalaland.chimney.fixtures.products.Accessors.Target2", "z: scala.Double - no accessor named z in source type io.scalaland.chimney.fixtures.products.Accessors.Source", @@ -1325,7 +1325,7 @@ class PartialTransformerProductSpec extends ChimneySpec { "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("Source(10).intoPartial[Target2].transform").check( + compileErrors("Source(10).intoPartial[Target2].transform").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.products.Accessors.Source to io.scalaland.chimney.fixtures.products.Accessors.Target2", "io.scalaland.chimney.fixtures.products.Accessors.Target2", "z: scala.Double - no accessor named z in source type io.scalaland.chimney.fixtures.products.Accessors.Source", @@ -1455,7 +1455,7 @@ class PartialTransformerProductSpec extends ChimneySpec { @unused implicit val config = TransformerConfiguration.default.enableMethodAccessors - compileErrorsFixed("""Source(10).into[Target2].disableMethodAccessors.transform""").check( + compileErrors("""Source(10).into[Target2].disableMethodAccessors.transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.products.Accessors.Source to io.scalaland.chimney.fixtures.products.Accessors.Target2", "io.scalaland.chimney.fixtures.products.Accessors.Target2", "z: scala.Double - no accessor named z in source type io.scalaland.chimney.fixtures.products.Accessors.Source", @@ -1478,7 +1478,7 @@ class PartialTransformerProductSpec extends ChimneySpec { test("should be disabled by default") { - compileErrorsFixed("""Foo(Foo.Baz("test"), 1024).transformIntoPartial[Bar]""").check( + compileErrors("""Foo(Foo.Baz("test"), 1024).transformIntoPartial[Bar]""").check( "Chimney can't derive transformation from io.scalaland.chimney.PartialTransformerProductSpec.Foo to io.scalaland.chimney.PartialTransformerProductSpec.Bar", "io.scalaland.chimney.PartialTransformerProductSpec.Bar", "baz: io.scalaland.chimney.PartialTransformerProductSpec.Bar.Baz - no accessor named baz in source type io.scalaland.chimney.PartialTransformerProductSpec.Foo", @@ -1486,7 +1486,7 @@ class PartialTransformerProductSpec extends ChimneySpec { "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("""Foo(Foo.Baz("test"), 1024).intoPartial[Bar].transform""").check( + compileErrors("""Foo(Foo.Baz("test"), 1024).intoPartial[Bar].transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.PartialTransformerProductSpec.Foo to io.scalaland.chimney.PartialTransformerProductSpec.Bar", "io.scalaland.chimney.PartialTransformerProductSpec.Bar", "baz: io.scalaland.chimney.PartialTransformerProductSpec.Bar.Baz - no accessor named baz in source type io.scalaland.chimney.PartialTransformerProductSpec.Foo", @@ -1494,7 +1494,7 @@ class PartialTransformerProductSpec extends ChimneySpec { "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("""Bar(Bar.Baz("test"), 1024).transformIntoPartial[Foo]""").check( + compileErrors("""Bar(Bar.Baz("test"), 1024).transformIntoPartial[Foo]""").check( "Chimney can't derive transformation from io.scalaland.chimney.PartialTransformerProductSpec.Bar to io.scalaland.chimney.PartialTransformerProductSpec.Foo", "io.scalaland.chimney.PartialTransformerProductSpec.Foo", "Baz: io.scalaland.chimney.PartialTransformerProductSpec.Foo.Baz - no accessor named Baz in source type io.scalaland.chimney.PartialTransformerProductSpec.Bar", @@ -1502,7 +1502,7 @@ class PartialTransformerProductSpec extends ChimneySpec { "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("""Bar(Bar.Baz("test"), 1024).intoPartial[Foo].transform""").check( + compileErrors("""Bar(Bar.Baz("test"), 1024).intoPartial[Foo].transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.PartialTransformerProductSpec.Bar to io.scalaland.chimney.PartialTransformerProductSpec.Foo", "io.scalaland.chimney.PartialTransformerProductSpec.Foo", "Baz: io.scalaland.chimney.PartialTransformerProductSpec.Foo.Baz - no accessor named Baz in source type io.scalaland.chimney.PartialTransformerProductSpec.Bar", @@ -1517,7 +1517,7 @@ class PartialTransformerProductSpec extends ChimneySpec { def namesMatch(fromName: String, toName: String): Boolean = fromName.equalsIgnoreCase(toName) } - compileErrorsFixed( + compileErrors( """Foo(Foo.Baz("test"), 1024).intoPartial[Bar].enableCustomFieldNameComparison(BadNameComparison).transform""" ) .check( @@ -1538,7 +1538,7 @@ class PartialTransformerProductSpec extends ChimneySpec { Bar(Bar.Baz("test"), 100) ) - compileErrorsFixed( + compileErrors( """ FooAmbiguous(FooAmbiguous.Baz("test", 10), 100, "test2").intoPartial[Bar] .enableCustomFieldNameComparison(TransformedNamesComparison.CaseInsensitiveEquality) @@ -1616,7 +1616,7 @@ class PartialTransformerProductSpec extends ChimneySpec { TransformedNamesComparison.CaseInsensitiveEquality ) - compileErrorsFixed("""Foo(Foo.Baz("test"), 1024).intoPartial[Bar].disableCustomFieldNameComparison.transform""") + compileErrors("""Foo(Foo.Baz("test"), 1024).intoPartial[Bar].disableCustomFieldNameComparison.transform""") .check( "Chimney can't derive transformation from io.scalaland.chimney.PartialTransformerProductSpec.Foo to io.scalaland.chimney.PartialTransformerProductSpec.Bar", "io.scalaland.chimney.PartialTransformerProductSpec.Bar", @@ -1625,7 +1625,7 @@ class PartialTransformerProductSpec extends ChimneySpec { "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("""Bar(Bar.Baz("test"), 1024).intoPartial[Foo].disableCustomFieldNameComparison.transform""") + compileErrors("""Bar(Bar.Baz("test"), 1024).intoPartial[Foo].disableCustomFieldNameComparison.transform""") .check( "Chimney can't derive transformation from io.scalaland.chimney.PartialTransformerProductSpec.Bar to io.scalaland.chimney.PartialTransformerProductSpec.Foo", "io.scalaland.chimney.PartialTransformerProductSpec.Foo", @@ -1883,7 +1883,7 @@ class PartialTransformerProductSpec extends ChimneySpec { test("compile error when optionDefaultsToNone were disabled locally") { - compileErrorsFixed("""(new Source).intoPartial[Target].disableOptionDefaultsToNone.transform""").check( + compileErrors("""(new Source).intoPartial[Target].disableOptionDefaultsToNone.transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.PartialTransformerProductSpec.Source to io.scalaland.chimney.PartialTransformerProductSpec.Target" ) } @@ -1901,7 +1901,7 @@ class PartialTransformerProductSpec extends ChimneySpec { test("ambiguous error when not resolved") { - compileErrorsFixed("""Foo("100").transformIntoPartial[Bar]""").check( + compileErrors("""Foo("100").transformIntoPartial[Bar]""").check( "Ambiguous implicits while resolving Chimney recursive transformation", "Please eliminate ambiguity from implicit scope or use enableImplicitConflictResolution/withFieldComputed/withFieldComputedPartial to decide which one should be used" ) @@ -1924,7 +1924,7 @@ class PartialTransformerProductSpec extends ChimneySpec { Foo("100").transformIntoPartial[Bar].asOption ==> Some(Bar(100)) test("disabled again should not compile") { - compileErrorsFixed( + compileErrors( """ Foo("100").intoPartial[Bar] .disableImplicitConflictResolution @@ -1955,7 +1955,7 @@ class PartialTransformerProductSpec extends ChimneySpec { test("disabled again should not compile") { - compileErrorsFixed( + compileErrors( """ Foo("100").intoPartial[Bar] .disableImplicitConflictResolution diff --git a/chimney/src/test/scala/io/scalaland/chimney/PartialTransformerSealedHierarchySpec.scala b/chimney/src/test/scala/io/scalaland/chimney/PartialTransformerSealedHierarchySpec.scala index af0241ed9..4079ca821 100644 --- a/chimney/src/test/scala/io/scalaland/chimney/PartialTransformerSealedHierarchySpec.scala +++ b/chimney/src/test/scala/io/scalaland/chimney/PartialTransformerSealedHierarchySpec.scala @@ -160,7 +160,7 @@ class PartialTransformerSealedHierarchySpec extends ChimneySpec { test( """should be absent by default and not allow transforming "superset" of case class to "subset" of case objects""" ) { - compileErrorsFixed("""(colors2.Black: colors2.Color).transformIntoPartial[colors1.Color]""").check( + compileErrors("""(colors2.Black: colors2.Color).transformIntoPartial[colors1.Color]""").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.colors2.Color to io.scalaland.chimney.fixtures.colors1.Color", "io.scalaland.chimney.fixtures.colors1.Color", "can't transform coproduct instance io.scalaland.chimney.fixtures.colors2.Black to io.scalaland.chimney.fixtures.colors1.Color", @@ -541,7 +541,7 @@ class PartialTransformerSealedHierarchySpec extends ChimneySpec { test("should be disabled by default") { - compileErrorsFixed("""(Foo.BAZ: Foo).transformIntoPartial[Bar]""").check( + compileErrors("""(Foo.BAZ: Foo).transformIntoPartial[Bar]""").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.renames.Subtypes.Foo to io.scalaland.chimney.fixtures.renames.Subtypes.Bar", "io.scalaland.chimney.fixtures.renames.Subtypes.Bar", "derivation from baz: io.scalaland.chimney.fixtures.renames.Subtypes.Foo.BAZ to io.scalaland.chimney.fixtures.renames.Subtypes.Bar is not supported in Chimney!", @@ -550,7 +550,7 @@ class PartialTransformerSealedHierarchySpec extends ChimneySpec { "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("""(Foo.BAZ: Foo).intoPartial[Bar].transform""").check( + compileErrors("""(Foo.BAZ: Foo).intoPartial[Bar].transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.renames.Subtypes.Foo to io.scalaland.chimney.fixtures.renames.Subtypes.Bar", "io.scalaland.chimney.fixtures.renames.Subtypes.Bar", "derivation from baz: io.scalaland.chimney.fixtures.renames.Subtypes.Foo.BAZ to io.scalaland.chimney.fixtures.renames.Subtypes.Bar is not supported in Chimney!", @@ -559,7 +559,7 @@ class PartialTransformerSealedHierarchySpec extends ChimneySpec { "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("""(Bar.Baz: Bar).transformIntoPartial[Foo]""").check( + compileErrors("""(Bar.Baz: Bar).transformIntoPartial[Foo]""").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.renames.Subtypes.Bar to io.scalaland.chimney.fixtures.renames.Subtypes.Foo", "io.scalaland.chimney.fixtures.renames.Subtypes.Foo", "derivation from baz: io.scalaland.chimney.fixtures.renames.Subtypes.Bar.Baz to io.scalaland.chimney.fixtures.renames.Subtypes.Foo is not supported in Chimney!", @@ -568,7 +568,7 @@ class PartialTransformerSealedHierarchySpec extends ChimneySpec { "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("""(Bar.Baz: Bar).intoPartial[Foo].transform""").check( + compileErrors("""(Bar.Baz: Bar).intoPartial[Foo].transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.renames.Subtypes.Bar to io.scalaland.chimney.fixtures.renames.Subtypes.Foo", "io.scalaland.chimney.fixtures.renames.Subtypes.Foo", "derivation from baz: io.scalaland.chimney.fixtures.renames.Subtypes.Bar.Baz to io.scalaland.chimney.fixtures.renames.Subtypes.Foo is not supported in Chimney!", @@ -584,7 +584,7 @@ class PartialTransformerSealedHierarchySpec extends ChimneySpec { def namesMatch(fromName: String, toName: String): Boolean = fromName.equalsIgnoreCase(toName) } - compileErrorsFixed("""(Foo.BAZ: Foo).into[Bar].enableCustomSubtypeNameComparison(BadNameComparison).transform""") + compileErrors("""(Foo.BAZ: Foo).into[Bar].enableCustomSubtypeNameComparison(BadNameComparison).transform""") .check( "Invalid TransformerNamesComparison type - only (case) objects are allowed, and only the ones defined as top-level or in top-level objects, got: io.scalaland.chimney.PartialTransformerSealedHierarchySpec.BadNameComparison!!!" ) @@ -595,7 +595,7 @@ class PartialTransformerSealedHierarchySpec extends ChimneySpec { (Foo2.baz: Foo2).transformIntoPartial[BarAmbiguous].asOption ==> Some(BarAmbiguous.baz) (Foo2.baz: Foo2).intoPartial[BarAmbiguous].transform.asOption ==> Some(BarAmbiguous.baz) - compileErrorsFixed( + compileErrors( """ (Foo2.baz: Foo2) .intoPartial[BarAmbiguous] @@ -666,7 +666,7 @@ class PartialTransformerSealedHierarchySpec extends ChimneySpec { TransformedNamesComparison.CaseInsensitiveEquality ) - compileErrorsFixed("""(Foo.BAZ: Foo).intoPartial[Bar].disableCustomSubtypeNameComparison.transform""").check( + compileErrors("""(Foo.BAZ: Foo).intoPartial[Bar].disableCustomSubtypeNameComparison.transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.renames.Subtypes.Foo to io.scalaland.chimney.fixtures.renames.Subtypes.Bar", "io.scalaland.chimney.fixtures.renames.Subtypes.Bar", "derivation from baz: io.scalaland.chimney.fixtures.renames.Subtypes.Foo.BAZ to io.scalaland.chimney.fixtures.renames.Subtypes.Bar is not supported in Chimney!", @@ -675,7 +675,7 @@ class PartialTransformerSealedHierarchySpec extends ChimneySpec { "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("""(Bar.Baz: Bar).intoPartial[Foo].disableCustomSubtypeNameComparison.transform""").check( + compileErrors("""(Bar.Baz: Bar).intoPartial[Foo].disableCustomSubtypeNameComparison.transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.renames.Subtypes.Bar to io.scalaland.chimney.fixtures.renames.Subtypes.Foo", "io.scalaland.chimney.fixtures.renames.Subtypes.Foo", "derivation from baz: io.scalaland.chimney.fixtures.renames.Subtypes.Bar.Baz to io.scalaland.chimney.fixtures.renames.Subtypes.Foo is not supported in Chimney!", diff --git a/chimney/src/test/scala/io/scalaland/chimney/PartialTransformerStdLibTypesSpec.scala b/chimney/src/test/scala/io/scalaland/chimney/PartialTransformerStdLibTypesSpec.scala index e0de5a0c6..8b246965e 100644 --- a/chimney/src/test/scala/io/scalaland/chimney/PartialTransformerStdLibTypesSpec.scala +++ b/chimney/src/test/scala/io/scalaland/chimney/PartialTransformerStdLibTypesSpec.scala @@ -13,7 +13,7 @@ class PartialTransformerStdLibTypesSpec extends ChimneySpec { @unused case class Buzz(value: String) @unused case class ConflictingFooBuzz(value: Unit) - compileErrorsFixed("""Buzz("a").transformIntoPartial[ConflictingFooBuzz]""").check( + compileErrors("""Buzz("a").transformIntoPartial[ConflictingFooBuzz]""").check( "Chimney can't derive transformation from io.scalaland.chimney.PartialTransformerStdLibTypesSpec.Buzz to io.scalaland.chimney.PartialTransformerStdLibTypesSpec.ConflictingFooBuzz", "io.scalaland.chimney.PartialTransformerStdLibTypesSpec.ConflictingFooBuzz", "value: scala.Unit - can't derive transformation from value: java.lang.String in source type io.scalaland.chimney.PartialTransformerStdLibTypesSpec.Buzz", @@ -495,13 +495,13 @@ class PartialTransformerStdLibTypesSpec extends ChimneySpec { case class TargetWithOptionAndDefault(x: String, y: Option[Int] = Some(42)) test("should be turned off by default and not allow compiling Option fields with missing source") { - compileErrorsFixed("""Source("foo").transformIntoPartial[TargetWithOption]""").check( + compileErrors("""Source("foo").transformIntoPartial[TargetWithOption]""").check( "Chimney can't derive transformation from io.scalaland.chimney.PartialTransformerStdLibTypesSpec.Source to io.scalaland.chimney.PartialTransformerStdLibTypesSpec.TargetWithOption", "io.scalaland.chimney.PartialTransformerStdLibTypesSpec.TargetWithOption", "y: scala.Option[scala.Int] - no accessor named y in source type io.scalaland.chimney.PartialTransformerStdLibTypesSpec.Source", "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("""Source("foo").intoPartial[TargetWithOption].transform""").check( + compileErrors("""Source("foo").intoPartial[TargetWithOption].transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.PartialTransformerStdLibTypesSpec.Source to io.scalaland.chimney.PartialTransformerStdLibTypesSpec.TargetWithOption", "io.scalaland.chimney.PartialTransformerStdLibTypesSpec.TargetWithOption", "y: scala.Option[scala.Int] - no accessor named y in source type io.scalaland.chimney.PartialTransformerStdLibTypesSpec.Source", @@ -563,7 +563,7 @@ class PartialTransformerStdLibTypesSpec extends ChimneySpec { test("should disable globally enabled .enableOptionDefaultsToNone") { @unused implicit val config = TransformerConfiguration.default.enableOptionDefaultsToNone - compileErrorsFixed("""Source("foo").intoPartial[TargetWithOption].disableOptionDefaultsToNone.transform""").check( + compileErrors("""Source("foo").intoPartial[TargetWithOption].disableOptionDefaultsToNone.transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.PartialTransformerStdLibTypesSpec.Source to io.scalaland.chimney.PartialTransformerStdLibTypesSpec.TargetWithOption", "io.scalaland.chimney.PartialTransformerStdLibTypesSpec.TargetWithOption", "y: scala.Option[scala.Int] - no accessor named y in source type io.scalaland.chimney.PartialTransformerStdLibTypesSpec.Source", @@ -595,7 +595,7 @@ class PartialTransformerStdLibTypesSpec extends ChimneySpec { @unused case class Target(a: String) test("should fail compilation if Option unwrapping is not provided when disabled") { - compileErrorsFixed("""Source(Some("value")).intoPartial[Target].disablePartialUnwrapsOption.transform""").check( + compileErrors("""Source(Some("value")).intoPartial[Target].disablePartialUnwrapsOption.transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.PartialTransformerStdLibTypesSpec.Source to io.scalaland.chimney.PartialTransformerStdLibTypesSpec.Target", "java.lang.String", "derivation from source.a: scala.Option[java.lang.String] to java.lang.String is not supported in Chimney!", @@ -606,7 +606,7 @@ class PartialTransformerStdLibTypesSpec extends ChimneySpec { locally { @unused implicit val config = TransformerConfiguration.default.disablePartialUnwrapsOption - compileErrorsFixed("""Source(Some("value")).transformIntoPartial[Target]""").check( + compileErrors("""Source(Some("value")).transformIntoPartial[Target]""").check( "Chimney can't derive transformation from io.scalaland.chimney.PartialTransformerStdLibTypesSpec.Source to io.scalaland.chimney.PartialTransformerStdLibTypesSpec.Target", "java.lang.String", "derivation from source.a: scala.Option[java.lang.String] to java.lang.String is not supported in Chimney!", diff --git a/chimney/src/test/scala/io/scalaland/chimney/PartialTransformerValueTypeSpec.scala b/chimney/src/test/scala/io/scalaland/chimney/PartialTransformerValueTypeSpec.scala index 4d4ef879a..0cd07bb34 100644 --- a/chimney/src/test/scala/io/scalaland/chimney/PartialTransformerValueTypeSpec.scala +++ b/chimney/src/test/scala/io/scalaland/chimney/PartialTransformerValueTypeSpec.scala @@ -10,16 +10,16 @@ class PartialTransformerValueTypeSpec extends ChimneySpec { test("AnyVals with private val and single accessor of different name/type are not considered value classes") { @unused val transformer: Transformer[String, Int] = (src: String) => src.length - compileErrorsFixed("new NotAValueType(100).transformIntoPartial[UserName]").check( + compileErrors("new NotAValueType(100).transformIntoPartial[UserName]").check( "derivation from value: io.scalaland.chimney.fixtures.valuetypes.NotAValueType to io.scalaland.chimney.fixtures.valuetypes.UserName is not supported in Chimney!" ) - compileErrorsFixed("new NotAValueType(100).transformIntoPartial[UserId]").check( + compileErrors("new NotAValueType(100).transformIntoPartial[UserId]").check( "derivation from notavaluetype: io.scalaland.chimney.fixtures.valuetypes.NotAValueType to scala.Int is not supported in Chimney!" ) - compileErrorsFixed("""UserName("Batman").transformIntoPartial[NotAValueType]""").check( + compileErrors("""UserName("Batman").transformIntoPartial[NotAValueType]""").check( "derivation from value: io.scalaland.chimney.fixtures.valuetypes.UserName to io.scalaland.chimney.fixtures.valuetypes.NotAValueType is not supported in Chimney!" ) - compileErrorsFixed("UserId(100).transformIntoPartial[NotAValueType]").check( + compileErrors("UserId(100).transformIntoPartial[NotAValueType]").check( "derivation from value: io.scalaland.chimney.fixtures.valuetypes.UserId to io.scalaland.chimney.fixtures.valuetypes.NotAValueType is not supported in Chimney!" ) } @@ -27,16 +27,16 @@ class PartialTransformerValueTypeSpec extends ChimneySpec { test("AnyVals with private private constructor are not considered value classes") { @unused val transformer: Transformer[String, Int] = (src: String) => src.length - compileErrorsFixed("AlsoNotAValueType.create(100).transformIntoPartial[UserName]").check( + compileErrors("AlsoNotAValueType.create(100).transformIntoPartial[UserName]").check( "derivation from value: io.scalaland.chimney.fixtures.valuetypes.AlsoNotAValueType to io.scalaland.chimney.fixtures.valuetypes.UserName is not supported in Chimney!" ) - compileErrorsFixed("AlsoNotAValueType.create(100).transformIntoPartial[UserId]").check( + compileErrors("AlsoNotAValueType.create(100).transformIntoPartial[UserId]").check( "derivation from alsonotavaluetype: io.scalaland.chimney.fixtures.valuetypes.AlsoNotAValueType to scala.Int is not supported in Chimney!" ) - compileErrorsFixed("""UserName("Batman").transformIntoPartial[AlsoNotAValueType]""").check( + compileErrors("""UserName("Batman").transformIntoPartial[AlsoNotAValueType]""").check( "derivation from username: io.scalaland.chimney.fixtures.valuetypes.UserName to io.scalaland.chimney.fixtures.valuetypes.AlsoNotAValueType is not supported in Chimney!" ) - compileErrorsFixed("UserId(100).transformIntoPartial[AlsoNotAValueType]").check( + compileErrors("UserId(100).transformIntoPartial[AlsoNotAValueType]").check( "derivation from userid: io.scalaland.chimney.fixtures.valuetypes.UserId to io.scalaland.chimney.fixtures.valuetypes.AlsoNotAValueType is not supported in Chimney!" ) } diff --git a/chimney/src/test/scala/io/scalaland/chimney/PatcherDslSeparationSpec.scala b/chimney/src/test/scala/io/scalaland/chimney/PatcherDslSeparationSpec.scala index f304a7e0f..05f278282 100644 --- a/chimney/src/test/scala/io/scalaland/chimney/PatcherDslSeparationSpec.scala +++ b/chimney/src/test/scala/io/scalaland/chimney/PatcherDslSeparationSpec.scala @@ -39,7 +39,7 @@ class PatcherDslSeparationSpec extends ChimneySpec { test("should not enable inlined derivation") { // format of missing method differ between 2 and 3 and we cannot rely on it - compileErrorsFixed("""Foo("test").using(Bar("test2")).patch""").arePresent() + compileErrors("""Foo("test").using(Bar("test2")).patch""").arePresent() } test("should not enable summoning declared instances") { @@ -47,7 +47,7 @@ class PatcherDslSeparationSpec extends ChimneySpec { Patcher.derive[Foo, Bar] // format of missing method differ between 2 and 3 and we cannot rely on it - compileErrorsFixed("""Foo("test").patchUsing(Bar("test2"))""").arePresent() + compileErrors("""Foo("test").patchUsing(Bar("test2"))""").arePresent() } } @@ -59,7 +59,7 @@ class PatcherDslSeparationSpec extends ChimneySpec { test("should not enable automatic derivation") { // format of missing implicit differ between 2 and 3 and we cannot rely on it - compileErrorsFixed("""Foo("test").patchUsing(Bar("test2"))""").arePresent() + compileErrors("""Foo("test").patchUsing(Bar("test2"))""").arePresent() } test("should enable inlined derivation") { @@ -71,7 +71,7 @@ class PatcherDslSeparationSpec extends ChimneySpec { Patcher.define[Foo, Bar].buildPatcher // format of missing method differ between 2 and 3 and we cannot rely on it - compileErrorsFixed("""Foo("test").patchUsing(Bar("test2"))""").arePresent() + compileErrors("""Foo("test").patchUsing(Bar("test2"))""").arePresent() } } @@ -83,12 +83,12 @@ class PatcherDslSeparationSpec extends ChimneySpec { test("should not enable automatic derivation") { // format of missing implicit differ between 2 and 3 and we cannot rely on it - compileErrorsFixed("""Foo("test").patchUsing(Bar("test2"))""").arePresent() + compileErrors("""Foo("test").patchUsing(Bar("test2"))""").arePresent() } test("should not enable inlined derivation") { // format of missing method differ between 2 and 3 and we cannot rely on it - compileErrorsFixed("""Foo("test").using(Bar("test2")).patch""").arePresent() + compileErrors("""Foo("test").using(Bar("test2")).patch""").arePresent() } test("should enable summoning declared instances") { diff --git a/chimney/src/test/scala/io/scalaland/chimney/PatcherProductSpec.scala b/chimney/src/test/scala/io/scalaland/chimney/PatcherProductSpec.scala index 076617bd0..9d3dacd6f 100644 --- a/chimney/src/test/scala/io/scalaland/chimney/PatcherProductSpec.scala +++ b/chimney/src/test/scala/io/scalaland/chimney/PatcherProductSpec.scala @@ -75,9 +75,9 @@ class PatcherProductSpec extends ChimneySpec { test("should fail compilation if transformation is not possible") { // without implicit Transformer[Int, String], it doesn't compile - compileErrorsFixed("""Obj("").patchUsing(Patch(100))""") + compileErrors("""Obj("").patchUsing(Patch(100))""") .check("not supported") - compileErrorsFixed("""Obj("").using(Patch(100)).patch""") + compileErrors("""Obj("").using(Patch(100)).patch""") .check("not supported") } @@ -101,17 +101,17 @@ class PatcherProductSpec extends ChimneySpec { test("should be disabled by default") { - compileErrorsFixed("exampleUser.patchUsing(patch1)").check( + compileErrors("exampleUser.patchUsing(patch1)").check( "Field named 'address' not found in target patching type io.scalaland.chimney.fixtures.PatchDomain.User!" ) - compileErrorsFixed("exampleUser.using(patch1).patch").check( + compileErrors("exampleUser.using(patch1).patch").check( "Field named 'address' not found in target patching type io.scalaland.chimney.fixtures.PatchDomain.User!" ) - compileErrorsFixed("exampleUser.patchUsing(patch2)").check( + compileErrors("exampleUser.patchUsing(patch2)").check( "Field named 'address' not found in target patching type io.scalaland.chimney.fixtures.PatchDomain.User!" ) - compileErrorsFixed("exampleUser.using(patch2).patch").check( + compileErrors("exampleUser.using(patch2).patch").check( "Field named 'address' not found in target patching type io.scalaland.chimney.fixtures.PatchDomain.User!" ) } @@ -156,11 +156,11 @@ class PatcherProductSpec extends ChimneySpec { // note address doesn't exist in User and it's at the beginning of the case class @unused val patch2 = PatchWithAnotherRedundantField("Unknown", Phone(4321L)) - compileErrorsFixed("exampleUser.using(patch1).failRedundantPatcherFields.patch").check( + compileErrors("exampleUser.using(patch1).failRedundantPatcherFields.patch").check( "Field named 'address' not found in target patching type io.scalaland.chimney.fixtures.PatchDomain.User!" ) - compileErrorsFixed("exampleUser.using(patch2).failRedundantPatcherFields.patch").check( + compileErrors("exampleUser.using(patch2).failRedundantPatcherFields.patch").check( "Field named 'address' not found in target patching type io.scalaland.chimney.fixtures.PatchDomain.User!" ) } diff --git a/chimney/src/test/scala/io/scalaland/chimney/TotalTransformerCustomConstructorSpec.scala b/chimney/src/test/scala/io/scalaland/chimney/TotalTransformerCustomConstructorSpec.scala index 4808cf89e..aa29b82a9 100644 --- a/chimney/src/test/scala/io/scalaland/chimney/TotalTransformerCustomConstructorSpec.scala +++ b/chimney/src/test/scala/io/scalaland/chimney/TotalTransformerCustomConstructorSpec.scala @@ -8,7 +8,7 @@ class TotalTransformerCustomConstructorSpec extends ChimneySpec { test("""not allow transformation when passed value is not a function/method""") { import products.{Foo, Bar} - compileErrorsFixed("""Foo(3, "pi", (3.14, 3.14)).into[Bar].withConstructor(Bar(4, (5.0, 5.0))).transform""").check( + compileErrors("""Foo(3, "pi", (3.14, 3.14)).into[Bar].withConstructor(Bar(4, (5.0, 5.0))).transform""").check( "Expected function of any arity (scala.Function0, scala.Function1, scala.Function2, ...) that returns a value of ", // difference between Scala 2 and 3 ", got io.scalaland.chimney.fixtures.products.Bar" ) diff --git a/chimney/src/test/scala/io/scalaland/chimney/TotalTransformerDslsSeparationSpec.scala b/chimney/src/test/scala/io/scalaland/chimney/TotalTransformerDslsSeparationSpec.scala index 9cc41ac72..c70fede6f 100644 --- a/chimney/src/test/scala/io/scalaland/chimney/TotalTransformerDslsSeparationSpec.scala +++ b/chimney/src/test/scala/io/scalaland/chimney/TotalTransformerDslsSeparationSpec.scala @@ -39,7 +39,7 @@ class TotalTransformerDslsSeparationSpec extends ChimneySpec { test("should not enable inlined derivation") { // format of missing method differ between 2 and 3 and we cannot rely on it - compileErrorsFixed("""Foo("test").into[Bar].transform""").arePresent() + compileErrors("""Foo("test").into[Bar].transform""").arePresent() } test("should not enable summoning declared instances") { @@ -47,7 +47,7 @@ class TotalTransformerDslsSeparationSpec extends ChimneySpec { Transformer.define[Foo, Bar].withFieldConst(_.baz, "test2").buildTransformer // format of missing method differ between 2 and 3 and we cannot rely on it - compileErrorsFixed("""Foo("test").transformInto[Bar]""").arePresent() + compileErrors("""Foo("test").transformInto[Bar]""").arePresent() } } @@ -59,7 +59,7 @@ class TotalTransformerDslsSeparationSpec extends ChimneySpec { test("should not enable automatic derivation") { // format of missing implicit differ between 2 and 3 and we cannot rely on it - compileErrorsFixed("""Foo("test").transformInto[Bar]""").arePresent() + compileErrors("""Foo("test").transformInto[Bar]""").arePresent() } test("should enable inlined derivation") { @@ -71,7 +71,7 @@ class TotalTransformerDslsSeparationSpec extends ChimneySpec { Transformer.define[Foo, Bar].withFieldConst(_.baz, "test2").buildTransformer // format of missing method differ between 2 and 3 and we cannot rely on it - compileErrorsFixed("""Foo("test").transformInto[Bar]""").arePresent() + compileErrors("""Foo("test").transformInto[Bar]""").arePresent() } } @@ -83,12 +83,12 @@ class TotalTransformerDslsSeparationSpec extends ChimneySpec { test("should not enable automatic derivation") { // format of missing implicit differ between 2 and 3 and we cannot rely on it - compileErrorsFixed("""Foo("test").transformInto[Bar]""").arePresent() + compileErrors("""Foo("test").transformInto[Bar]""").arePresent() } test("should not enable inlined derivation") { // format of missing method differ between 2 and 3 and we cannot rely on it - compileErrorsFixed("""Foo("test").into[Bar].transform""").arePresent() + compileErrors("""Foo("test").into[Bar].transform""").arePresent() } test("should enable summoning declared instances") { diff --git a/chimney/src/test/scala/io/scalaland/chimney/TotalTransformerIntegrationsSpec.scala b/chimney/src/test/scala/io/scalaland/chimney/TotalTransformerIntegrationsSpec.scala index 5507c3864..62d8f245f 100644 --- a/chimney/src/test/scala/io/scalaland/chimney/TotalTransformerIntegrationsSpec.scala +++ b/chimney/src/test/scala/io/scalaland/chimney/TotalTransformerIntegrationsSpec.scala @@ -19,7 +19,7 @@ class TotalTransformerIntegrationsSpec extends ChimneySpec { Possible("abc").transformInto[Possible[String]] ==> Possible.Present("abc") Possible(Foo("a")).transformInto[Option[Bar]] ==> Option(Bar("a")) Option(Foo("a")).transformInto[Possible[Bar]] ==> Possible(Bar("a")) - compileErrorsFixed("""Possible("foobar").into[None.type].transform""").check( + compileErrors("""Possible("foobar").into[None.type].transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.TotalTransformerIntegrationsSpec.Possible[java.lang.String] to scala.None", "scala.None", "derivation from possible: io.scalaland.chimney.TotalTransformerIntegrationsSpec.Possible[java.lang.String] to scala.None is not supported in Chimney!", @@ -47,7 +47,7 @@ class TotalTransformerIntegrationsSpec extends ChimneySpec { test("read from PartiallyBuildIterable but not write to it") { NonEmptyCollection.of(Foo("a")).transformInto[CustomCollection[Bar]] ==> CustomCollection.of(Bar("a")) - compileErrorsFixed("""CustomCollection.of(Foo("a")).transformInto[NonEmptyCollection[Bar]]""").check( + compileErrors("""CustomCollection.of(Foo("a")).transformInto[NonEmptyCollection[Bar]]""").check( "Chimney can't derive transformation from io.scalaland.chimney.TotalTransformerIntegrationsSpec.CustomCollection[io.scalaland.chimney.TotalTransformerStdLibTypesSpec.Foo] to io.scalaland.chimney.TotalTransformerIntegrationsSpec.NonEmptyCollection[io.scalaland.chimney.TotalTransformerStdLibTypesSpec.Bar]", "io.scalaland.chimney.TotalTransformerIntegrationsSpec.NonEmptyCollection[io.scalaland.chimney.TotalTransformerStdLibTypesSpec.Bar]", "derivation from customcollection: io.scalaland.chimney.TotalTransformerIntegrationsSpec.CustomCollection[io.scalaland.chimney.TotalTransformerStdLibTypesSpec.Foo] to io.scalaland.chimney.TotalTransformerIntegrationsSpec.NonEmptyCollection[io.scalaland.chimney.TotalTransformerStdLibTypesSpec.Bar] is not supported in Chimney!", @@ -84,7 +84,7 @@ class TotalTransformerIntegrationsSpec extends ChimneySpec { test("read from PartiallyBuildIterable but not write to it") { NonEmptyMap.of(Foo("k") -> Foo("v")).transformInto[CustomMap[Bar, Bar]] ==> CustomMap.of(Bar("k") -> Bar("v")) - compileErrorsFixed("""CustomMap.of(Foo("k") -> Foo("v")).transformInto[NonEmptyMap[Bar, Bar]]""").check( + compileErrors("""CustomMap.of(Foo("k") -> Foo("v")).transformInto[NonEmptyMap[Bar, Bar]]""").check( "Chimney can't derive transformation from io.scalaland.chimney.TotalTransformerIntegrationsSpec.CustomMap[io.scalaland.chimney.TotalTransformerStdLibTypesSpec.Foo, io.scalaland.chimney.TotalTransformerStdLibTypesSpec.Foo] to io.scalaland.chimney.TotalTransformerIntegrationsSpec.NonEmptyMap[io.scalaland.chimney.TotalTransformerStdLibTypesSpec.Bar, io.scalaland.chimney.TotalTransformerStdLibTypesSpec.Bar]", "io.scalaland.chimney.TotalTransformerIntegrationsSpec.NonEmptyMap[io.scalaland.chimney.TotalTransformerStdLibTypesSpec.Bar, io.scalaland.chimney.TotalTransformerStdLibTypesSpec.Bar]", "derivation from custommap: io.scalaland.chimney.TotalTransformerIntegrationsSpec.CustomMap[io.scalaland.chimney.TotalTransformerStdLibTypesSpec.Foo, io.scalaland.chimney.TotalTransformerStdLibTypesSpec.Foo] to io.scalaland.chimney.TotalTransformerIntegrationsSpec.NonEmptyMap[io.scalaland.chimney.TotalTransformerStdLibTypesSpec.Bar, io.scalaland.chimney.TotalTransformerStdLibTypesSpec.Bar] is not supported in Chimney!", @@ -113,7 +113,7 @@ class TotalTransformerIntegrationsSpec extends ChimneySpec { case class TargetWithOptionAndDefault(x: String, y: Possible[Int] = Possible.Present(42)) test("should be turned off by default and not allow compiling OptionalValue fields with missing source") { - compileErrorsFixed("""Source("foo").into[TargetWithOption].transform""").check( + compileErrors("""Source("foo").into[TargetWithOption].transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.TotalTransformerIntegrationsSpec.Source to io.scalaland.chimney.TotalTransformerIntegrationsSpec.TargetWithOption", "io.scalaland.chimney.TotalTransformerIntegrationsSpec.TargetWithOption", "y: io.scalaland.chimney.TotalTransformerIntegrationsSpec.Possible[scala.Int] - no accessor named y in source type io.scalaland.chimney.TotalTransformerIntegrationsSpec.Source", @@ -162,7 +162,7 @@ class TotalTransformerIntegrationsSpec extends ChimneySpec { test("should disable globally enabled .enableOptionDefaultsToNone") { @unused implicit val config = TransformerConfiguration.default.enableOptionDefaultsToNone - compileErrorsFixed("""Source("foo").into[TargetWithOption].disableOptionDefaultsToNone.transform""").check( + compileErrors("""Source("foo").into[TargetWithOption].disableOptionDefaultsToNone.transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.TotalTransformerIntegrationsSpec.Source to io.scalaland.chimney.TotalTransformerIntegrationsSpec.TargetWithOption", "io.scalaland.chimney.TotalTransformerIntegrationsSpec.TargetWithOption", "y: io.scalaland.chimney.TotalTransformerIntegrationsSpec.Possible[scala.Int] - no accessor named y in source type io.scalaland.chimney.TotalTransformerIntegrationsSpec.Source", diff --git a/chimney/src/test/scala/io/scalaland/chimney/TotalTransformerJavaBeanSpec.scala b/chimney/src/test/scala/io/scalaland/chimney/TotalTransformerJavaBeanSpec.scala index 1b92ffdf8..4a903d4a3 100644 --- a/chimney/src/test/scala/io/scalaland/chimney/TotalTransformerJavaBeanSpec.scala +++ b/chimney/src/test/scala/io/scalaland/chimney/TotalTransformerJavaBeanSpec.scala @@ -9,7 +9,7 @@ import scala.annotation.unused class TotalTransformerJavaBeanSpec extends ChimneySpec { test("automatic reading from Java Bean getters should be disabled by default") { - compileErrorsFixed( + compileErrors( """new JavaBeanSourceWithFlag(id = "test-id", name = "test-name", flag = true).into[CaseClassWithFlag].transform""" ).check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.javabeans.JavaBeanSourceWithFlag to io.scalaland.chimney.fixtures.javabeans.CaseClassWithFlag", @@ -22,7 +22,7 @@ class TotalTransformerJavaBeanSpec extends ChimneySpec { } test("automatic writing to Java Bean setters should be disabled by default") { - compileErrorsFixed("""CaseClassWithFlag("100", "name", flag = true).into[JavaBeanTarget].transform""").check( + compileErrors("""CaseClassWithFlag("100", "name", flag = true).into[JavaBeanTarget].transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.javabeans.CaseClassWithFlag to io.scalaland.chimney.fixtures.javabeans.JavaBeanTarget", "io.scalaland.chimney.fixtures.javabeans.JavaBeanTarget", "derivation from caseclasswithflag: io.scalaland.chimney.fixtures.javabeans.CaseClassWithFlag to io.scalaland.chimney.fixtures.javabeans.JavaBeanTarget is not supported in Chimney!", @@ -31,7 +31,7 @@ class TotalTransformerJavaBeanSpec extends ChimneySpec { } test("var vs setter ambiguities should be reported to the user") { - compileErrorsFixed( + compileErrors( """ new JavaBeanSourceWithAmbiguity("200", "name", flag = true) .into[JavaBeanTarget] @@ -146,7 +146,7 @@ class TotalTransformerJavaBeanSpec extends ChimneySpec { } test("should fail to compile when getter is not paired with the right setter") { - compileErrorsFixed( + compileErrors( """CaseClassWithFlagRenamed("test-id", "test-name", renamedFlag = true).into[JavaBeanTargetNoIdSetter].withFieldRenamed(_.id, _.getId).transform""" ).check( "Assumed that parameter/setter getId is a part of io.scalaland.chimney.fixtures.javabeans.JavaBeanTargetNoIdSetter, but wasn't found" @@ -175,7 +175,7 @@ class TotalTransformerJavaBeanSpec extends ChimneySpec { } test("not compile when matching an is- getter with type other than Boolean") { - compileErrorsFixed( + compileErrors( """ case class MistypedTarget(flag: Int) class MistypedSource(private var flag: Int) { @@ -190,7 +190,7 @@ class TotalTransformerJavaBeanSpec extends ChimneySpec { locally { @unused implicit val config = TransformerConfiguration.default.enableBeanGetters - compileErrorsFixed( + compileErrors( """ case class MistypedTarget(flag: Int) class MistypedSource(private var flag: Int) { @@ -210,7 +210,7 @@ class TotalTransformerJavaBeanSpec extends ChimneySpec { test("should disable globally enabled .enableBeanGetters") { @unused implicit val config = TransformerConfiguration.default.enableBeanGetters - compileErrorsFixed( + compileErrors( """ new JavaBeanSourceWithFlag(id = "test-id", name = "test-name", flag = true) .into[CaseClassWithFlag] @@ -248,7 +248,7 @@ class TotalTransformerJavaBeanSpec extends ChimneySpec { } test("should not compile when accessors are missing") { - compileErrorsFixed( + compileErrors( """ CaseClassNoFlag("100", "name") .into[JavaBeanTarget] @@ -262,7 +262,7 @@ class TotalTransformerJavaBeanSpec extends ChimneySpec { locally { @unused implicit val config = TransformerConfiguration.default.enableBeanSetters - compileErrorsFixed( + compileErrors( """ CaseClassNoFlag("100", "name") .into[JavaBeanTarget] @@ -275,7 +275,7 @@ class TotalTransformerJavaBeanSpec extends ChimneySpec { } test("should not compile when method accessor is disabled") { - compileErrorsFixed( + compileErrors( """ CaseClassWithFlagMethod("100", "name") .into[JavaBeanTarget] @@ -293,7 +293,7 @@ class TotalTransformerJavaBeanSpec extends ChimneySpec { locally { @unused implicit val config = TransformerConfiguration.default.enableBeanSetters - compileErrorsFixed( + compileErrors( """ CaseClassWithFlagMethod("100", "name") .into[JavaBeanTarget] @@ -333,7 +333,7 @@ class TotalTransformerJavaBeanSpec extends ChimneySpec { test("should disable globally enabled .enableBeanSetters") { @unused implicit val config = TransformerConfiguration.default.enableBeanSetters - compileErrorsFixed( + compileErrors( """ CaseClassWithFlag("100", "name", flag = true) .into[JavaBeanTarget] @@ -352,7 +352,7 @@ class TotalTransformerJavaBeanSpec extends ChimneySpec { group("""flag .enableIgnoreUnmatchedBeanSetters""") { test("should be disabled by default") { - compileErrorsFixed("().transformInto[JavaBeanTarget]").check( + compileErrors("().transformInto[JavaBeanTarget]").check( "Chimney can't derive transformation from scala.Unit to io.scalaland.chimney.fixtures.javabeans.JavaBeanTarget", "io.scalaland.chimney.fixtures.javabeans.JavaBeanTarget", "setName(name: java.lang.String) - no accessor named name in source type scala.Unit", @@ -361,7 +361,7 @@ class TotalTransformerJavaBeanSpec extends ChimneySpec { "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("().into[JavaBeanTarget].transform").check( + compileErrors("().into[JavaBeanTarget].transform").check( "Chimney can't derive transformation from scala.Unit to io.scalaland.chimney.fixtures.javabeans.JavaBeanTarget", "io.scalaland.chimney.fixtures.javabeans.JavaBeanTarget", "setName(name: java.lang.String) - no accessor named name in source type scala.Unit", @@ -393,7 +393,7 @@ class TotalTransformerJavaBeanSpec extends ChimneySpec { expected.setId("100") expected.setName("name") - compileErrorsFixed( + compileErrors( """ CaseClassNoFlag("100", "name") .into[JavaBeanTarget] @@ -410,7 +410,7 @@ class TotalTransformerJavaBeanSpec extends ChimneySpec { locally { @unused implicit val config = TransformerConfiguration.default.enableIgnoreUnmatchedBeanSetters - compileErrorsFixed( + compileErrors( """ CaseClassNoFlag("100", "name") .into[JavaBeanTarget] @@ -452,7 +452,7 @@ class TotalTransformerJavaBeanSpec extends ChimneySpec { test("should disable globally enabled .enableIgnoreUnmatchedBeanSetters") { @unused implicit val config = TransformerConfiguration.default.enableIgnoreUnmatchedBeanSetters - compileErrorsFixed( + compileErrors( """ CaseClassWithFlag("100", "name", flag = true) .into[JavaBeanTarget] @@ -551,7 +551,7 @@ class TotalTransformerJavaBeanSpec extends ChimneySpec { test("should disable globally enabled .MethodAccessors") { @unused implicit val config = TransformerConfiguration.default.enableMethodAccessors - compileErrorsFixed( + compileErrors( """ CaseClassWithFlagMethod("100", "name") .into[JavaBeanTarget] @@ -580,9 +580,9 @@ class TotalTransformerJavaBeanSpec extends ChimneySpec { expected.setFlag(false) // need to enable both setters and getters; only one of them is not enough for this use case! - compileErrorsFixed("source.into[JavaBeanTarget].transform").arePresent() - compileErrorsFixed("source.into[JavaBeanTarget].enableBeanGetters.transform").arePresent() - compileErrorsFixed("source.into[JavaBeanTarget].enableBeanSetters.transform").arePresent() + compileErrors("source.into[JavaBeanTarget].transform").arePresent() + compileErrors("source.into[JavaBeanTarget].enableBeanGetters.transform").arePresent() + compileErrors("source.into[JavaBeanTarget].enableBeanSetters.transform").arePresent() source .into[JavaBeanTarget] diff --git a/chimney/src/test/scala/io/scalaland/chimney/TotalTransformerProductSpec.scala b/chimney/src/test/scala/io/scalaland/chimney/TotalTransformerProductSpec.scala index a8014924f..7bd986e25 100644 --- a/chimney/src/test/scala/io/scalaland/chimney/TotalTransformerProductSpec.scala +++ b/chimney/src/test/scala/io/scalaland/chimney/TotalTransformerProductSpec.scala @@ -20,14 +20,14 @@ class TotalTransformerProductSpec extends ChimneySpec { ) { import products.{Foo, Bar} - compileErrorsFixed("Bar(3, (3.14, 3.14)).into[Foo].transform").check( + compileErrors("Bar(3, (3.14, 3.14)).into[Foo].transform").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.products.Bar to io.scalaland.chimney.fixtures.products.Foo", "io.scalaland.chimney.fixtures.products.Foo", "y: java.lang.String - no accessor named y in source type io.scalaland.chimney.fixtures.products.Bar", "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("Bar(3, (3.14, 3.14)).transformInto[Foo]").check( + compileErrors("Bar(3, (3.14, 3.14)).transformInto[Foo]").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.products.Bar to io.scalaland.chimney.fixtures.products.Foo", "io.scalaland.chimney.fixtures.products.Foo", "y: java.lang.String - no accessor named y in source type io.scalaland.chimney.fixtures.products.Bar", @@ -56,28 +56,28 @@ class TotalTransformerProductSpec extends ChimneySpec { test("should not compile when selector is invalid") { import products.{Foo, Bar, HaveY} - compileErrorsFixed("""Bar(3, (3.14, 3.14)).into[Foo].withFieldConst(_.y + "abc", "pi").transform""").check( + compileErrors("""Bar(3, (3.14, 3.14)).into[Foo].withFieldConst(_.y + "abc", "pi").transform""").check( "The path expression has to be a single chain of calls on the original input, got operation other than value extraction:" ) - compileErrorsFixed( + compileErrors( """ val haveY = HaveY("") Bar(3, (3.14, 3.14)).into[Foo].withFieldConst(cc => haveY.y, "pi").transform """ ).check("The path expression has to be a single chain of calls on the original input, got external identifier:") - compileErrorsFixed("""Bar(3, (3.14, 3.14)).into[Foo].withFieldConst(_.matching, "pi").transform""").arePresent() - compileErrorsFixed("""Bar(3, (3.14, 3.14)).into[Foo].withFieldConst(_.matchingSome, "pi").transform""") + compileErrors("""Bar(3, (3.14, 3.14)).into[Foo].withFieldConst(_.matching, "pi").transform""").arePresent() + compileErrors("""Bar(3, (3.14, 3.14)).into[Foo].withFieldConst(_.matchingSome, "pi").transform""") .arePresent() - compileErrorsFixed("""Bar(3, (3.14, 3.14)).into[Foo].withFieldConst(_.matchingLeft, "pi").transform""") + compileErrors("""Bar(3, (3.14, 3.14)).into[Foo].withFieldConst(_.matchingLeft, "pi").transform""") .arePresent() - compileErrorsFixed("""Bar(3, (3.14, 3.14)).into[Foo].withFieldConst(_.matchingRight, "pi").transform""") + compileErrors("""Bar(3, (3.14, 3.14)).into[Foo].withFieldConst(_.matchingRight, "pi").transform""") .arePresent() - compileErrorsFixed("""Bar(3, (3.14, 3.14)).into[Foo].withFieldConst(_.everyItem, "pi").transform""").arePresent() - compileErrorsFixed("""Bar(3, (3.14, 3.14)).into[Foo].withFieldConst(_.everyMapKey, "pi").transform""") + compileErrors("""Bar(3, (3.14, 3.14)).into[Foo].withFieldConst(_.everyItem, "pi").transform""").arePresent() + compileErrors("""Bar(3, (3.14, 3.14)).into[Foo].withFieldConst(_.everyMapKey, "pi").transform""") .arePresent() - compileErrorsFixed("""Bar(3, (3.14, 3.14)).into[Foo].withFieldConst(_.everyMapValue, "pi").transform""") + compileErrors("""Bar(3, (3.14, 3.14)).into[Foo].withFieldConst(_.everyMapValue, "pi").transform""") .arePresent() } @@ -153,31 +153,31 @@ class TotalTransformerProductSpec extends ChimneySpec { test("should not compile when selector is invalid") { import products.{Foo, Bar, HaveY} - compileErrorsFixed("""Bar(3, (3.14, 3.14)).into[Foo].withFieldComputed(_.y + "abc", _.toString).transform""") + compileErrors("""Bar(3, (3.14, 3.14)).into[Foo].withFieldComputed(_.y + "abc", _.toString).transform""") .check( "The path expression has to be a single chain of calls on the original input, got operation other than value extraction:" ) - compileErrorsFixed( + compileErrors( """ val haveY = HaveY("") Bar(3, (3.14, 3.14)).into[Foo].withFieldComputed(cc => haveY.y, _.toString).transform """ ).check("The path expression has to be a single chain of calls on the original input, got external identifier:") - compileErrorsFixed("""Bar(3, (3.14, 3.14)).into[Foo].withFieldComputed(_.matching, _.toString).transform""") + compileErrors("""Bar(3, (3.14, 3.14)).into[Foo].withFieldComputed(_.matching, _.toString).transform""") .arePresent() - compileErrorsFixed("""Bar(3, (3.14, 3.14)).into[Foo].withFieldComputed(_.matchingSome, _.toString).transform""") + compileErrors("""Bar(3, (3.14, 3.14)).into[Foo].withFieldComputed(_.matchingSome, _.toString).transform""") .arePresent() - compileErrorsFixed("""Bar(3, (3.14, 3.14)).into[Foo].withFieldComputed(_.matchingLeft, _.toString).transform""") + compileErrors("""Bar(3, (3.14, 3.14)).into[Foo].withFieldComputed(_.matchingLeft, _.toString).transform""") .arePresent() - compileErrorsFixed("""Bar(3, (3.14, 3.14)).into[Foo].withFieldComputed(_.matchingRight, _.toString).transform""") + compileErrors("""Bar(3, (3.14, 3.14)).into[Foo].withFieldComputed(_.matchingRight, _.toString).transform""") .arePresent() - compileErrorsFixed("""Bar(3, (3.14, 3.14)).into[Foo].withFieldComputed(_.everyItem, _.toString).transform""") + compileErrors("""Bar(3, (3.14, 3.14)).into[Foo].withFieldComputed(_.everyItem, _.toString).transform""") .arePresent() - compileErrorsFixed("""Bar(3, (3.14, 3.14)).into[Foo].withFieldComputed(_.everyMapKey, _.toString).transform""") + compileErrors("""Bar(3, (3.14, 3.14)).into[Foo].withFieldComputed(_.everyMapKey, _.toString).transform""") .arePresent() - compileErrorsFixed("""Bar(3, (3.14, 3.14)).into[Foo].withFieldComputed(_.everyMapValue, _.toString).transform""") + compileErrors("""Bar(3, (3.14, 3.14)).into[Foo].withFieldComputed(_.everyMapValue, _.toString).transform""") .arePresent() } @@ -257,7 +257,7 @@ class TotalTransformerProductSpec extends ChimneySpec { test("should not be enabled by default") { import products.Renames.* - compileErrorsFixed("""User(1, "Kuba", Some(28)).transformInto[UserPL]""").check( + compileErrors("""User(1, "Kuba", Some(28)).transformInto[UserPL]""").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.products.Renames.User to io.scalaland.chimney.fixtures.products.Renames.UserPL", "io.scalaland.chimney.fixtures.products.Renames.UserPL", "imie: java.lang.String - no accessor named imie in source type io.scalaland.chimney.fixtures.products.Renames.User", @@ -265,7 +265,7 @@ class TotalTransformerProductSpec extends ChimneySpec { "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("""User(1, "Kuba", Some(28)).into[UserPL].transform""").check( + compileErrors("""User(1, "Kuba", Some(28)).into[UserPL].transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.products.Renames.User to io.scalaland.chimney.fixtures.products.Renames.UserPL", "io.scalaland.chimney.fixtures.products.Renames.UserPL", "imie: java.lang.String - no accessor named imie in source type io.scalaland.chimney.fixtures.products.Renames.User", @@ -277,13 +277,13 @@ class TotalTransformerProductSpec extends ChimneySpec { test("should not compile when selector is invalid") { import products.Renames.* - compileErrorsFixed( + compileErrors( """User(1, "Kuba", Some(28)).into[UserPL].withFieldRenamed(_.age + "ABC", _.toString).transform""" ).check( "The path expression has to be a single chain of calls on the original input, got operation other than value extraction:" ) - compileErrorsFixed( + compileErrors( """ val str = "string" User(1, "Kuba", Some(28)).into[UserPL].withFieldRenamed(u => str, _.toString).transform @@ -292,37 +292,37 @@ class TotalTransformerProductSpec extends ChimneySpec { "The path expression has to be a single chain of calls on the original input, got external identifier:" ) - compileErrorsFixed( + compileErrors( """ Bar(3, (3.14, 3.14)).into[Foo].withFieldRenamed(_.matching, _.toString).transform """ ).arePresent() - compileErrorsFixed( + compileErrors( """ Bar(3, (3.14, 3.14)).into[Foo].withFieldRenamed(_.matchingSome, _.toString).transform """ ).arePresent() - compileErrorsFixed( + compileErrors( """ Bar(3, (3.14, 3.14)).into[Foo].withFieldRenamed(_.matchingLeft, _.toString).transform """ ).arePresent() - compileErrorsFixed( + compileErrors( """ Bar(3, (3.14, 3.14)).into[Foo].withFieldRenamed(_.matchingRight, _.toString).transform """ ).arePresent() - compileErrorsFixed( + compileErrors( """ Bar(3, (3.14, 3.14)).into[Foo].withFieldRenamed(_.everyItem, _.toString).transform """ ).arePresent() - compileErrorsFixed( + compileErrors( """ Bar(3, (3.14, 3.14)).into[Foo].withFieldRenamed(_.everyMapKey, _.toString).transform """ ).arePresent() - compileErrorsFixed( + compileErrors( """ Bar(3, (3.14, 3.14)).into[Foo].withFieldRenamed(_.everyMapValue, _.toString).transform """ @@ -404,7 +404,7 @@ class TotalTransformerProductSpec extends ChimneySpec { test("should not compile if renamed value change type but an there is no transformer available") { import products.Renames.* - compileErrorsFixed( + compileErrors( """ User(1, "Kuba", Some(28)) .into[UserPL] @@ -483,7 +483,7 @@ class TotalTransformerProductSpec extends ChimneySpec { method4: String, method5: String ) - compileErrorsFixed("""Foobar("param").into[Foobar5].transform""").check( + compileErrors("""Foobar("param").into[Foobar5].transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.TotalTransformerProductSpec.Foobar to io.scalaland.chimney.TotalTransformerProductSpec.Foobar5", "io.scalaland.chimney.TotalTransformerProductSpec.Foobar5", "method1: java.lang.String - no accessor named method1 in source type io.scalaland.chimney.TotalTransformerProductSpec.Foobar", @@ -508,7 +508,7 @@ class TotalTransformerProductSpec extends ChimneySpec { test("protected and private methods are not considered (even if accessible)") { @unused case class Foo2(param: String, protect: String, priv: String) - compileErrorsFixed("""Foobar("param").into[Foo2].enableMethodAccessors.transform""").check( + compileErrors("""Foobar("param").into[Foo2].enableMethodAccessors.transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.TotalTransformerProductSpec.Foobar to io.scalaland.chimney.TotalTransformerProductSpec.Foo2", "io.scalaland.chimney.TotalTransformerProductSpec.Foo2", "protect: java.lang.String - no accessor named protect in source type io.scalaland.chimney.TotalTransformerProductSpec.Foobar", @@ -524,7 +524,7 @@ class TotalTransformerProductSpec extends ChimneySpec { test("should be disabled by default") { import products.Defaults.* - compileErrorsFixed("""Source(1, "yy", 1.0).transformInto[Target]""").check( + compileErrors("""Source(1, "yy", 1.0).transformInto[Target]""").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.products.Defaults.Source to io.scalaland.chimney.fixtures.products.Defaults.Target", "io.scalaland.chimney.fixtures.products.Defaults.Target", "x: scala.Int - no accessor named x in source type io.scalaland.chimney.fixtures.products.Defaults.Source", @@ -532,7 +532,7 @@ class TotalTransformerProductSpec extends ChimneySpec { "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("""Source(1, "yy", 1.0).into[Target].transform""").check( + compileErrors("""Source(1, "yy", 1.0).into[Target].transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.products.Defaults.Source to io.scalaland.chimney.fixtures.products.Defaults.Target", "io.scalaland.chimney.fixtures.products.Defaults.Target", "x: scala.Int - no accessor named x in source type io.scalaland.chimney.fixtures.products.Defaults.Source", @@ -603,7 +603,7 @@ class TotalTransformerProductSpec extends ChimneySpec { ) { import products.Defaults.* - compileErrorsFixed("""Source(1, "yy", 1.0).into[Target2].enableDefaultValues.transform""").check( + compileErrors("""Source(1, "yy", 1.0).into[Target2].enableDefaultValues.transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.products.Defaults.Source to io.scalaland.chimney.fixtures.products.Defaults.Target2", "io.scalaland.chimney.fixtures.products.Defaults.Target2", "xx: scala.Long - can't derive transformation from xx: scala.Int in source type io.scalaland.chimney.fixtures.products.Defaults.Source", @@ -613,13 +613,13 @@ class TotalTransformerProductSpec extends ChimneySpec { locally { @unused implicit val config = TransformerConfiguration.default.enableDefaultValues - compileErrorsFixed("""Source(1, "yy", 1.0).transformInto[Target2]""").check( + compileErrors("""Source(1, "yy", 1.0).transformInto[Target2]""").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.products.Defaults.Source to io.scalaland.chimney.fixtures.products.Defaults.Target2", "io.scalaland.chimney.fixtures.products.Defaults.Target2", "xx: scala.Long - can't derive transformation from xx: scala.Int in source type io.scalaland.chimney.fixtures.products.Defaults.Source", "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("""Source(1, "yy", 1.0).into[Target2].transform""").check( + compileErrors("""Source(1, "yy", 1.0).into[Target2].transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.products.Defaults.Source to io.scalaland.chimney.fixtures.products.Defaults.Target2", "io.scalaland.chimney.fixtures.products.Defaults.Target2", "xx: scala.Long - can't derive transformation from xx: scala.Int in source type io.scalaland.chimney.fixtures.products.Defaults.Source", @@ -653,7 +653,7 @@ class TotalTransformerProductSpec extends ChimneySpec { @unused implicit val config = TransformerConfiguration.default.enableDefaultValues - compileErrorsFixed("""Source(1, "yy", 1.0).into[Target].disableDefaultValues.transform""").check( + compileErrors("""Source(1, "yy", 1.0).into[Target].disableDefaultValues.transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.products.Defaults.Source to io.scalaland.chimney.fixtures.products.Defaults.Target", "io.scalaland.chimney.fixtures.products.Defaults.Target", "x: scala.Int - no accessor named x in source type io.scalaland.chimney.fixtures.products.Defaults.Source", @@ -668,7 +668,7 @@ class TotalTransformerProductSpec extends ChimneySpec { test("should be disabled by default") { import products.Inherited.* - compileErrorsFixed("(new Source).transformInto[Target]").check( + compileErrors("(new Source).transformInto[Target]").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.products.Inherited.Source to io.scalaland.chimney.fixtures.products.Inherited.Target", "io.scalaland.chimney.fixtures.products.Inherited.Target", "value: java.lang.String - no accessor named value in source type io.scalaland.chimney.fixtures.products.Inherited.Source", @@ -676,7 +676,7 @@ class TotalTransformerProductSpec extends ChimneySpec { "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("(new Source).intoPartial[Target].transform").check( + compileErrors("(new Source).intoPartial[Target].transform").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.products.Inherited.Source to io.scalaland.chimney.fixtures.products.Inherited.Target", "io.scalaland.chimney.fixtures.products.Inherited.Target", "value: java.lang.String - no accessor named value in source type io.scalaland.chimney.fixtures.products.Inherited.Source", @@ -705,7 +705,7 @@ class TotalTransformerProductSpec extends ChimneySpec { @unused implicit val cfg = TransformerConfiguration.default.enableInheritedAccessors - compileErrorsFixed("(new Source).into[Target].disableInheritedAccessors.transform").check( + compileErrors("(new Source).into[Target].disableInheritedAccessors.transform").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.products.Inherited.Source to io.scalaland.chimney.fixtures.products.Inherited.Target", "io.scalaland.chimney.fixtures.products.Inherited.Target", "value: java.lang.String - no accessor named value in source type io.scalaland.chimney.fixtures.products.Inherited.Source", @@ -720,7 +720,7 @@ class TotalTransformerProductSpec extends ChimneySpec { test("should be disabled by default") { import products.Accessors.* - compileErrorsFixed("Source(10).transformInto[Target2]").check( + compileErrors("Source(10).transformInto[Target2]").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.products.Accessors.Source to io.scalaland.chimney.fixtures.products.Accessors.Target2", "io.scalaland.chimney.fixtures.products.Accessors.Target2", "z: scala.Double - no accessor named z in source type io.scalaland.chimney.fixtures.products.Accessors.Source", @@ -728,7 +728,7 @@ class TotalTransformerProductSpec extends ChimneySpec { "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("Source(10).into[Target2].transform").check( + compileErrors("Source(10).into[Target2].transform").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.products.Accessors.Source to io.scalaland.chimney.fixtures.products.Accessors.Target2", "io.scalaland.chimney.fixtures.products.Accessors.Target2", "z: scala.Double - no accessor named z in source type io.scalaland.chimney.fixtures.products.Accessors.Source", @@ -802,7 +802,7 @@ class TotalTransformerProductSpec extends ChimneySpec { @unused implicit val config = TransformerConfiguration.default.enableMethodAccessors - compileErrorsFixed("""Source(10).into[Target2].disableMethodAccessors.transform""").check( + compileErrors("""Source(10).into[Target2].disableMethodAccessors.transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.products.Accessors.Source to io.scalaland.chimney.fixtures.products.Accessors.Target2", "io.scalaland.chimney.fixtures.products.Accessors.Target2", "z: scala.Double - no accessor named z in source type io.scalaland.chimney.fixtures.products.Accessors.Source", @@ -825,7 +825,7 @@ class TotalTransformerProductSpec extends ChimneySpec { test("should be disabled by default") { - compileErrorsFixed("""Foo(Foo.Baz("test"), 1024).transformInto[Bar]""").check( + compileErrors("""Foo(Foo.Baz("test"), 1024).transformInto[Bar]""").check( "Chimney can't derive transformation from io.scalaland.chimney.TotalTransformerProductSpec.Foo to io.scalaland.chimney.TotalTransformerProductSpec.Bar", "io.scalaland.chimney.TotalTransformerProductSpec.Bar", "baz: io.scalaland.chimney.TotalTransformerProductSpec.Bar.Baz - no accessor named baz in source type io.scalaland.chimney.TotalTransformerProductSpec.Foo", @@ -833,7 +833,7 @@ class TotalTransformerProductSpec extends ChimneySpec { "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("""Foo(Foo.Baz("test"), 1024).into[Bar].transform""").check( + compileErrors("""Foo(Foo.Baz("test"), 1024).into[Bar].transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.TotalTransformerProductSpec.Foo to io.scalaland.chimney.TotalTransformerProductSpec.Bar", "io.scalaland.chimney.TotalTransformerProductSpec.Bar", "baz: io.scalaland.chimney.TotalTransformerProductSpec.Bar.Baz - no accessor named baz in source type io.scalaland.chimney.TotalTransformerProductSpec.Foo", @@ -841,7 +841,7 @@ class TotalTransformerProductSpec extends ChimneySpec { "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("""Bar(Bar.Baz("test"), 1024).transformInto[Foo]""").check( + compileErrors("""Bar(Bar.Baz("test"), 1024).transformInto[Foo]""").check( "Chimney can't derive transformation from io.scalaland.chimney.TotalTransformerProductSpec.Bar to io.scalaland.chimney.TotalTransformerProductSpec.Foo", "io.scalaland.chimney.TotalTransformerProductSpec.Foo", "Baz: io.scalaland.chimney.TotalTransformerProductSpec.Foo.Baz - no accessor named Baz in source type io.scalaland.chimney.TotalTransformerProductSpec.Bar", @@ -849,7 +849,7 @@ class TotalTransformerProductSpec extends ChimneySpec { "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("""Bar(Bar.Baz("test"), 1024).into[Foo].transform""").check( + compileErrors("""Bar(Bar.Baz("test"), 1024).into[Foo].transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.TotalTransformerProductSpec.Bar to io.scalaland.chimney.TotalTransformerProductSpec.Foo", "io.scalaland.chimney.TotalTransformerProductSpec.Foo", "Baz: io.scalaland.chimney.TotalTransformerProductSpec.Foo.Baz - no accessor named Baz in source type io.scalaland.chimney.TotalTransformerProductSpec.Bar", @@ -864,7 +864,7 @@ class TotalTransformerProductSpec extends ChimneySpec { def namesMatch(fromName: String, toName: String): Boolean = fromName.equalsIgnoreCase(toName) } - compileErrorsFixed( + compileErrors( """Foo(Foo.Baz("test"), 1024).into[Bar].enableCustomFieldNameComparison(BadNameComparison).transform""" ) .check( @@ -881,7 +881,7 @@ class TotalTransformerProductSpec extends ChimneySpec { FooAmbiguous(FooAmbiguous.Baz("test", 10), 100, "test2").transformInto[Bar] ==> Bar(Bar.Baz("test"), 100) FooAmbiguous(FooAmbiguous.Baz("test", 10), 100, "test2").into[Bar].transform ==> Bar(Bar.Baz("test"), 100) - compileErrorsFixed( + compileErrors( """ FooAmbiguous(FooAmbiguous.Baz("test", 10), 100, "test2").into[Bar] .enableCustomFieldNameComparison(TransformedNamesComparison.CaseInsensitiveEquality) @@ -941,7 +941,7 @@ class TotalTransformerProductSpec extends ChimneySpec { TransformedNamesComparison.CaseInsensitiveEquality ) - compileErrorsFixed("""Foo(Foo.Baz("test"), 1024).into[Bar].disableCustomFieldNameComparison.transform""").check( + compileErrors("""Foo(Foo.Baz("test"), 1024).into[Bar].disableCustomFieldNameComparison.transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.TotalTransformerProductSpec.Foo to io.scalaland.chimney.TotalTransformerProductSpec.Bar", "io.scalaland.chimney.TotalTransformerProductSpec.Bar", "baz: io.scalaland.chimney.TotalTransformerProductSpec.Bar.Baz - no accessor named baz in source type io.scalaland.chimney.TotalTransformerProductSpec.Foo", @@ -949,7 +949,7 @@ class TotalTransformerProductSpec extends ChimneySpec { "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("""Bar(Bar.Baz("test"), 1024).into[Foo].disableCustomFieldNameComparison.transform""").check( + compileErrors("""Bar(Bar.Baz("test"), 1024).into[Foo].disableCustomFieldNameComparison.transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.TotalTransformerProductSpec.Bar to io.scalaland.chimney.TotalTransformerProductSpec.Foo", "io.scalaland.chimney.TotalTransformerProductSpec.Foo", "Baz: io.scalaland.chimney.TotalTransformerProductSpec.Foo.Baz - no accessor named Baz in source type io.scalaland.chimney.TotalTransformerProductSpec.Bar", @@ -1074,17 +1074,17 @@ class TotalTransformerProductSpec extends ChimneySpec { test("handle tuple transformation errors") { - compileErrorsFixed("""(0, "test").transformInto[Foo]""").check( + compileErrors("""(0, "test").transformInto[Foo]""").check( "source tuple scala.Tuple2[scala.Int, java.lang.String] is of arity 2, while target type io.scalaland.chimney.TotalTransformerProductSpec.Foo is of arity 3; they need to be equal!" ) - compileErrorsFixed("""(10.5, "abc", 6).transformInto[Foo]""").check("can't derive transformation") + compileErrors("""(10.5, "abc", 6).transformInto[Foo]""").check("can't derive transformation") - compileErrorsFixed("""Foo(10, 36.6, "test").transformInto[(Double, String, Int, Float, Boolean)]""").check( + compileErrors("""Foo(10, 36.6, "test").transformInto[(Double, String, Int, Float, Boolean)]""").check( "source tuple io.scalaland.chimney.TotalTransformerProductSpec.Foo is of arity 3, while target type scala.Tuple5[scala.Double, java.lang.String, scala.Int, scala.Float, scala.Boolean] is of arity 5; they need to be equal!" ) - compileErrorsFixed("""Foo(10, 36.6, "test").transformInto[(Int, Double, Boolean)]""").check( + compileErrors("""Foo(10, 36.6, "test").transformInto[(Int, Double, Boolean)]""").check( "can't derive transformation" ) } diff --git a/chimney/src/test/scala/io/scalaland/chimney/TotalTransformerSealedHierarchySpec.scala b/chimney/src/test/scala/io/scalaland/chimney/TotalTransformerSealedHierarchySpec.scala index b13ca39b5..0622f1f31 100644 --- a/chimney/src/test/scala/io/scalaland/chimney/TotalTransformerSealedHierarchySpec.scala +++ b/chimney/src/test/scala/io/scalaland/chimney/TotalTransformerSealedHierarchySpec.scala @@ -123,7 +123,7 @@ class TotalTransformerSealedHierarchySpec extends ChimneySpec { test( """should be absent by default and not allow transforming "superset" of case class to "subset" of case objects""" ) { - compileErrorsFixed("""(colors2.Black: colors2.Color).transformInto[colors1.Color]""").check( + compileErrors("""(colors2.Black: colors2.Color).transformInto[colors1.Color]""").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.colors2.Color to io.scalaland.chimney.fixtures.colors1.Color", "io.scalaland.chimney.fixtures.colors1.Color", "can't transform coproduct instance io.scalaland.chimney.fixtures.colors2.Black to io.scalaland.chimney.fixtures.colors1.Color", @@ -285,7 +285,7 @@ class TotalTransformerSealedHierarchySpec extends ChimneySpec { test("should be disabled by default") { - compileErrorsFixed("""(Foo.BAZ: Foo).transformInto[Bar]""").check( + compileErrors("""(Foo.BAZ: Foo).transformInto[Bar]""").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.renames.Subtypes.Foo to io.scalaland.chimney.fixtures.renames.Subtypes.Bar", "io.scalaland.chimney.fixtures.renames.Subtypes.Bar", "derivation from baz: io.scalaland.chimney.fixtures.renames.Subtypes.Foo.BAZ to io.scalaland.chimney.fixtures.renames.Subtypes.Bar is not supported in Chimney!", @@ -294,7 +294,7 @@ class TotalTransformerSealedHierarchySpec extends ChimneySpec { "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("""(Foo.BAZ: Foo).into[Bar].transform""").check( + compileErrors("""(Foo.BAZ: Foo).into[Bar].transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.renames.Subtypes.Foo to io.scalaland.chimney.fixtures.renames.Subtypes.Bar", "io.scalaland.chimney.fixtures.renames.Subtypes.Bar", "derivation from baz: io.scalaland.chimney.fixtures.renames.Subtypes.Foo.BAZ to io.scalaland.chimney.fixtures.renames.Subtypes.Bar is not supported in Chimney!", @@ -303,7 +303,7 @@ class TotalTransformerSealedHierarchySpec extends ChimneySpec { "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("""(Bar.Baz: Bar).transformInto[Foo]""").check( + compileErrors("""(Bar.Baz: Bar).transformInto[Foo]""").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.renames.Subtypes.Bar to io.scalaland.chimney.fixtures.renames.Subtypes.Foo", "io.scalaland.chimney.fixtures.renames.Subtypes.Foo", "derivation from baz: io.scalaland.chimney.fixtures.renames.Subtypes.Bar.Baz to io.scalaland.chimney.fixtures.renames.Subtypes.Foo is not supported in Chimney!", @@ -312,7 +312,7 @@ class TotalTransformerSealedHierarchySpec extends ChimneySpec { "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("""(Bar.Baz: Bar).into[Foo].transform""").check( + compileErrors("""(Bar.Baz: Bar).into[Foo].transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.renames.Subtypes.Bar to io.scalaland.chimney.fixtures.renames.Subtypes.Foo", "io.scalaland.chimney.fixtures.renames.Subtypes.Foo", "derivation from baz: io.scalaland.chimney.fixtures.renames.Subtypes.Bar.Baz to io.scalaland.chimney.fixtures.renames.Subtypes.Foo is not supported in Chimney!", @@ -328,7 +328,7 @@ class TotalTransformerSealedHierarchySpec extends ChimneySpec { def namesMatch(fromName: String, toName: String): Boolean = fromName.equalsIgnoreCase(toName) } - compileErrorsFixed("""(Foo.BAZ: Foo).into[Bar].enableCustomSubtypeNameComparison(BadNameComparison).transform""") + compileErrors("""(Foo.BAZ: Foo).into[Bar].enableCustomSubtypeNameComparison(BadNameComparison).transform""") .check( "Invalid TransformerNamesComparison type - only (case) objects are allowed, and only the ones defined as top-level or in top-level objects, got: io.scalaland.chimney.TotalTransformerSealedHierarchySpec.BadNameComparison!!!" ) @@ -339,7 +339,7 @@ class TotalTransformerSealedHierarchySpec extends ChimneySpec { (Foo2.baz: Foo2).transformInto[BarAmbiguous] ==> BarAmbiguous.baz (Foo2.baz: Foo2).into[BarAmbiguous].transform ==> BarAmbiguous.baz - compileErrorsFixed( + compileErrors( """ (Foo2.baz: Foo2) .into[BarAmbiguous] @@ -390,7 +390,7 @@ class TotalTransformerSealedHierarchySpec extends ChimneySpec { TransformedNamesComparison.CaseInsensitiveEquality ) - compileErrorsFixed("""(Foo.BAZ: Foo).into[Bar].disableCustomSubtypeNameComparison.transform""").check( + compileErrors("""(Foo.BAZ: Foo).into[Bar].disableCustomSubtypeNameComparison.transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.renames.Subtypes.Foo to io.scalaland.chimney.fixtures.renames.Subtypes.Bar", "io.scalaland.chimney.fixtures.renames.Subtypes.Bar", "derivation from baz: io.scalaland.chimney.fixtures.renames.Subtypes.Foo.BAZ to io.scalaland.chimney.fixtures.renames.Subtypes.Bar is not supported in Chimney!", @@ -399,7 +399,7 @@ class TotalTransformerSealedHierarchySpec extends ChimneySpec { "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("""(Bar.Baz: Bar).into[Foo].disableCustomSubtypeNameComparison.transform""").check( + compileErrors("""(Bar.Baz: Bar).into[Foo].disableCustomSubtypeNameComparison.transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.fixtures.renames.Subtypes.Bar to io.scalaland.chimney.fixtures.renames.Subtypes.Foo", "io.scalaland.chimney.fixtures.renames.Subtypes.Foo", "derivation from baz: io.scalaland.chimney.fixtures.renames.Subtypes.Bar.Baz to io.scalaland.chimney.fixtures.renames.Subtypes.Foo is not supported in Chimney!", diff --git a/chimney/src/test/scala/io/scalaland/chimney/TotalTransformerStdLibTypesSpec.scala b/chimney/src/test/scala/io/scalaland/chimney/TotalTransformerStdLibTypesSpec.scala index a65c22a6e..0041d0742 100644 --- a/chimney/src/test/scala/io/scalaland/chimney/TotalTransformerStdLibTypesSpec.scala +++ b/chimney/src/test/scala/io/scalaland/chimney/TotalTransformerStdLibTypesSpec.scala @@ -12,7 +12,7 @@ class TotalTransformerStdLibTypesSpec extends ChimneySpec { @unused case class Buzz(value: String) @unused case class ConflictingFooBuzz(value: Unit) - compileErrorsFixed("""Buzz("a").transformInto[ConflictingFooBuzz]""").check( + compileErrors("""Buzz("a").transformInto[ConflictingFooBuzz]""").check( "Chimney can't derive transformation from io.scalaland.chimney.TotalTransformerStdLibTypesSpec.Buzz to io.scalaland.chimney.TotalTransformerStdLibTypesSpec.ConflictingFooBuzz", "io.scalaland.chimney.TotalTransformerStdLibTypesSpec.ConflictingFooBuzz", "value: scala.Unit - can't derive transformation from value: java.lang.String in source type io.scalaland.chimney.TotalTransformerStdLibTypesSpec.Buzz", @@ -40,14 +40,14 @@ class TotalTransformerStdLibTypesSpec extends ChimneySpec { (None: Option[Foo]).transformInto[Option[Bar]] ==> None (None: Option[String]).transformInto[Option[String]] ==> None Option("abc").transformInto[Option[String]] ==> Some("abc") - compileErrorsFixed("""Some("foobar").into[None.type].transform""").check( + compileErrors("""Some("foobar").into[None.type].transform""").check( "Chimney can't derive transformation from scala.Some[java.lang.String] to scala.None", "scala.None", "derivation from some: scala.Some[java.lang.String] to scala.None is not supported in Chimney!", "Consult https://chimney.readthedocs.io for usage examples." ) @unused case class BarNone(value: None.type) - compileErrorsFixed("""Foo("a").into[BarNone].transform""").check( + compileErrors("""Foo("a").into[BarNone].transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.TotalTransformerStdLibTypesSpec.Foo to io.scalaland.chimney.TotalTransformerStdLibTypesSpec.BarNone", "io.scalaland.chimney.TotalTransformerStdLibTypesSpec.BarNone", "value: scala.None - can't derive transformation from value: java.lang.String in source type io.scalaland.chimney.TotalTransformerStdLibTypesSpec.Foo", @@ -178,7 +178,7 @@ class TotalTransformerStdLibTypesSpec extends ChimneySpec { case class TargetWithOptionAndDefault(x: String, y: Option[Int] = Some(42)) test("should be turned off by default and not allow compiling Option fields with missing source") { - compileErrorsFixed("""Source("foo").into[TargetWithOption].transform""").check( + compileErrors("""Source("foo").into[TargetWithOption].transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.TotalTransformerStdLibTypesSpec.Source to io.scalaland.chimney.TotalTransformerStdLibTypesSpec.TargetWithOption", "io.scalaland.chimney.TotalTransformerStdLibTypesSpec.TargetWithOption", "y: scala.Option[scala.Int] - no accessor named y in source type io.scalaland.chimney.TotalTransformerStdLibTypesSpec.Source", @@ -222,7 +222,7 @@ class TotalTransformerStdLibTypesSpec extends ChimneySpec { test("should disable globally enabled .enableOptionDefaultsToNone") { @unused implicit val config = TransformerConfiguration.default.enableOptionDefaultsToNone - compileErrorsFixed("""Source("foo").into[TargetWithOption].disableOptionDefaultsToNone.transform""").check( + compileErrors("""Source("foo").into[TargetWithOption].disableOptionDefaultsToNone.transform""").check( "Chimney can't derive transformation from io.scalaland.chimney.TotalTransformerStdLibTypesSpec.Source to io.scalaland.chimney.TotalTransformerStdLibTypesSpec.TargetWithOption", "io.scalaland.chimney.TotalTransformerStdLibTypesSpec.TargetWithOption", "y: scala.Option[scala.Int] - no accessor named y in source type io.scalaland.chimney.TotalTransformerStdLibTypesSpec.Source", diff --git a/chimney/src/test/scala/io/scalaland/chimney/TotalTransformerValueTypeSpec.scala b/chimney/src/test/scala/io/scalaland/chimney/TotalTransformerValueTypeSpec.scala index 712998a70..eef20e3c1 100644 --- a/chimney/src/test/scala/io/scalaland/chimney/TotalTransformerValueTypeSpec.scala +++ b/chimney/src/test/scala/io/scalaland/chimney/TotalTransformerValueTypeSpec.scala @@ -10,16 +10,16 @@ class TotalTransformerValueTypeSpec extends ChimneySpec { test("AnyVals with private val and single accessor of different name/type are not considered value classes") { @unused val transformer: Transformer[String, Int] = (src: String) => src.length - compileErrorsFixed("new NotAValueType(100).transformInto[UserName]").check( + compileErrors("new NotAValueType(100).transformInto[UserName]").check( "derivation from value: io.scalaland.chimney.fixtures.valuetypes.NotAValueType to io.scalaland.chimney.fixtures.valuetypes.UserName is not supported in Chimney!" ) - compileErrorsFixed("new NotAValueType(100).transformInto[UserId]").check( + compileErrors("new NotAValueType(100).transformInto[UserId]").check( "derivation from notavaluetype: io.scalaland.chimney.fixtures.valuetypes.NotAValueType to scala.Int is not supported in Chimney!" ) - compileErrorsFixed("""UserName("Batman").transformInto[NotAValueType]""").check( + compileErrors("""UserName("Batman").transformInto[NotAValueType]""").check( "derivation from value: io.scalaland.chimney.fixtures.valuetypes.UserName to io.scalaland.chimney.fixtures.valuetypes.NotAValueType is not supported in Chimney!" ) - compileErrorsFixed("UserId(100).transformInto[NotAValueType]").check( + compileErrors("UserId(100).transformInto[NotAValueType]").check( "derivation from value: io.scalaland.chimney.fixtures.valuetypes.UserId to io.scalaland.chimney.fixtures.valuetypes.NotAValueType is not supported in Chimney!" ) } @@ -27,16 +27,16 @@ class TotalTransformerValueTypeSpec extends ChimneySpec { test("AnyVals with private private constructor are not considered value classes") { @unused val transformer: Transformer[String, Int] = (src: String) => src.length - compileErrorsFixed("AlsoNotAValueType.create(100).transformInto[UserName]").check( + compileErrors("AlsoNotAValueType.create(100).transformInto[UserName]").check( "derivation from value: io.scalaland.chimney.fixtures.valuetypes.AlsoNotAValueType to io.scalaland.chimney.fixtures.valuetypes.UserName is not supported in Chimney!" ) - compileErrorsFixed("AlsoNotAValueType.create(100).transformInto[UserId]").check( + compileErrors("AlsoNotAValueType.create(100).transformInto[UserId]").check( "derivation from alsonotavaluetype: io.scalaland.chimney.fixtures.valuetypes.AlsoNotAValueType to scala.Int is not supported in Chimney!" ) - compileErrorsFixed("""UserName("Batman").transformInto[AlsoNotAValueType]""").check( + compileErrors("""UserName("Batman").transformInto[AlsoNotAValueType]""").check( "derivation from username: io.scalaland.chimney.fixtures.valuetypes.UserName to io.scalaland.chimney.fixtures.valuetypes.AlsoNotAValueType is not supported in Chimney!" ) - compileErrorsFixed("UserId(100).transformInto[AlsoNotAValueType]").check( + compileErrors("UserId(100).transformInto[AlsoNotAValueType]").check( "derivation from userid: io.scalaland.chimney.fixtures.valuetypes.UserId to io.scalaland.chimney.fixtures.valuetypes.AlsoNotAValueType is not supported in Chimney!" ) } diff --git a/chimney/src/test/scalajvm/io/scalaland/chimney/PartialTransformerJavaEnumSpec.scala b/chimney/src/test/scalajvm/io/scalaland/chimney/PartialTransformerJavaEnumSpec.scala index 04f650738..afc93a17d 100644 --- a/chimney/src/test/scalajvm/io/scalaland/chimney/PartialTransformerJavaEnumSpec.scala +++ b/chimney/src/test/scalajvm/io/scalaland/chimney/PartialTransformerJavaEnumSpec.scala @@ -79,7 +79,7 @@ class PartialTransformerJavaEnumSpec extends ChimneySpec { test( """should be absent by default and not allow transforming Java Enum "superset" instances to sealed hierarchy "subset" of case objects""" ) { - compileErrorsFixed("""(jcolors2.Color.Black: jcolors2.Color).transformIntoPartial[colors1.Color]""").check( + compileErrors("""(jcolors2.Color.Black: jcolors2.Color).transformIntoPartial[colors1.Color]""").check( "Chimney can't derive transformation from io.scalaland.chimney.javafixtures.jcolors2.Color to io.scalaland.chimney.fixtures.colors1.Color", "io.scalaland.chimney.fixtures.colors1.Color", "can't transform coproduct instance io.scalaland.chimney.javafixtures.jcolors2.Color.Black to io.scalaland.chimney.fixtures.colors1.Color", @@ -227,7 +227,7 @@ class PartialTransformerJavaEnumSpec extends ChimneySpec { test("should be disabled by default") { - compileErrorsFixed("(Foo.bar: Foo).transformIntoPartial[Bar]").check( + compileErrors("(Foo.bar: Foo).transformIntoPartial[Bar]").check( "Chimney can't derive transformation from io.scalaland.chimney.javafixtures.jrenames.Foo to io.scalaland.chimney.javafixtures.jrenames.Bar", "io.scalaland.chimney.javafixtures.jrenames.Bar", "derivation from bar: io.scalaland.chimney.javafixtures.jrenames.Foo.bar to io.scalaland.chimney.javafixtures.jrenames.Bar is not supported in Chimney!", @@ -236,7 +236,7 @@ class PartialTransformerJavaEnumSpec extends ChimneySpec { "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("(Foo.bar: Foo).intoPartial[Bar].transform").check( + compileErrors("(Foo.bar: Foo).intoPartial[Bar].transform").check( "Chimney can't derive transformation from io.scalaland.chimney.javafixtures.jrenames.Foo to io.scalaland.chimney.javafixtures.jrenames.Bar", "io.scalaland.chimney.javafixtures.jrenames.Bar", "derivation from bar: io.scalaland.chimney.javafixtures.jrenames.Foo.bar to io.scalaland.chimney.javafixtures.jrenames.Bar is not supported in Chimney!", @@ -252,7 +252,7 @@ class PartialTransformerJavaEnumSpec extends ChimneySpec { def namesMatch(fromName: String, toName: String): Boolean = fromName.equalsIgnoreCase(toName) } - compileErrorsFixed( + compileErrors( """(Foo.bar: Foo).intoPartial[Bar].enableCustomSubtypeNameComparison(BadNameComparison).transform""" ) .check( @@ -262,7 +262,7 @@ class PartialTransformerJavaEnumSpec extends ChimneySpec { test("should inform user when the matcher they provided results in ambiguities") { - compileErrorsFixed( + compileErrors( """ (Foo.bar: Foo) .intoPartial[BarAmbiguous] @@ -305,7 +305,7 @@ class PartialTransformerJavaEnumSpec extends ChimneySpec { @unused implicit val config = TransformerConfiguration.default .enableCustomSubtypeNameComparison(TransformedNamesComparison.CaseInsensitiveEquality) - compileErrorsFixed("(Foo.bar: Foo).intoPartial[Bar].disableCustomSubtypeNameComparison.transform").check( + compileErrors("(Foo.bar: Foo).intoPartial[Bar].disableCustomSubtypeNameComparison.transform").check( "Chimney can't derive transformation from io.scalaland.chimney.javafixtures.jrenames.Foo to io.scalaland.chimney.javafixtures.jrenames.Bar", "io.scalaland.chimney.javafixtures.jrenames.Bar", "derivation from bar: io.scalaland.chimney.javafixtures.jrenames.Foo.bar to io.scalaland.chimney.javafixtures.jrenames.Bar is not supported in Chimney!", diff --git a/chimney/src/test/scalajvm/io/scalaland/chimney/TotalTransformerJavaEnumSpec.scala b/chimney/src/test/scalajvm/io/scalaland/chimney/TotalTransformerJavaEnumSpec.scala index 8bbb31d8a..f234cbc15 100644 --- a/chimney/src/test/scalajvm/io/scalaland/chimney/TotalTransformerJavaEnumSpec.scala +++ b/chimney/src/test/scalajvm/io/scalaland/chimney/TotalTransformerJavaEnumSpec.scala @@ -79,7 +79,7 @@ class TotalTransformerJavaEnumSpec extends ChimneySpec { test( """should be absent by default and not allow transforming Java Enum "superset" instances to sealed hierarchy "subset" of case objects""" ) { - compileErrorsFixed("""(jcolors2.Color.Black: jcolors2.Color).transformInto[colors1.Color]""").check( + compileErrors("""(jcolors2.Color.Black: jcolors2.Color).transformInto[colors1.Color]""").check( "Chimney can't derive transformation from io.scalaland.chimney.javafixtures.jcolors2.Color to io.scalaland.chimney.fixtures.colors1.Color", "io.scalaland.chimney.fixtures.colors1.Color", "can't transform coproduct instance io.scalaland.chimney.javafixtures.jcolors2.Color.Black to io.scalaland.chimney.fixtures.colors1.Color", @@ -151,7 +151,7 @@ class TotalTransformerJavaEnumSpec extends ChimneySpec { test("should be disabled by default") { - compileErrorsFixed("(Foo.bar: Foo).transformInto[Bar]").check( + compileErrors("(Foo.bar: Foo).transformInto[Bar]").check( "Chimney can't derive transformation from io.scalaland.chimney.javafixtures.jrenames.Foo to io.scalaland.chimney.javafixtures.jrenames.Bar", "io.scalaland.chimney.javafixtures.jrenames.Bar", "derivation from bar: io.scalaland.chimney.javafixtures.jrenames.Foo.bar to io.scalaland.chimney.javafixtures.jrenames.Bar is not supported in Chimney!", @@ -160,7 +160,7 @@ class TotalTransformerJavaEnumSpec extends ChimneySpec { "Consult https://chimney.readthedocs.io for usage examples." ) - compileErrorsFixed("(Foo.bar: Foo).into[Bar].transform").check( + compileErrors("(Foo.bar: Foo).into[Bar].transform").check( "Chimney can't derive transformation from io.scalaland.chimney.javafixtures.jrenames.Foo to io.scalaland.chimney.javafixtures.jrenames.Bar", "io.scalaland.chimney.javafixtures.jrenames.Bar", "derivation from bar: io.scalaland.chimney.javafixtures.jrenames.Foo.bar to io.scalaland.chimney.javafixtures.jrenames.Bar is not supported in Chimney!", @@ -176,7 +176,7 @@ class TotalTransformerJavaEnumSpec extends ChimneySpec { def namesMatch(fromName: String, toName: String): Boolean = fromName.equalsIgnoreCase(toName) } - compileErrorsFixed("""(Foo.bar: Foo).into[Bar].enableCustomSubtypeNameComparison(BadNameComparison).transform""") + compileErrors("""(Foo.bar: Foo).into[Bar].enableCustomSubtypeNameComparison(BadNameComparison).transform""") .check( "Invalid TransformerNamesComparison type - only (case) objects are allowed, and only the ones defined as top-level or in top-level objects, got: io.scalaland.chimney.TotalTransformerJavaEnumSpec.BadNameComparison!!!" ) @@ -184,7 +184,7 @@ class TotalTransformerJavaEnumSpec extends ChimneySpec { test("should inform user when the matcher they provided results in ambiguities") { - compileErrorsFixed( + compileErrors( """ (Foo.bar: Foo) .into[BarAmbiguous] @@ -226,7 +226,7 @@ class TotalTransformerJavaEnumSpec extends ChimneySpec { @unused implicit val config = TransformerConfiguration.default .enableCustomSubtypeNameComparison(TransformedNamesComparison.CaseInsensitiveEquality) - compileErrorsFixed("(Foo.bar: Foo).into[Bar].disableCustomSubtypeNameComparison.transform").check( + compileErrors("(Foo.bar: Foo).into[Bar].disableCustomSubtypeNameComparison.transform").check( "Chimney can't derive transformation from io.scalaland.chimney.javafixtures.jrenames.Foo to io.scalaland.chimney.javafixtures.jrenames.Bar", "io.scalaland.chimney.javafixtures.jrenames.Bar", "derivation from bar: io.scalaland.chimney.javafixtures.jrenames.Foo.bar to io.scalaland.chimney.javafixtures.jrenames.Bar is not supported in Chimney!",