是否有更优雅的方法来测试由Scala-macros生成的编译错误而不是粘贴到下面?
assert(intercept[TestFailedException](assertCompiles {
"""case class DuplicatedNamed(@named("x") @named("y") z: Int)
|JsonCodecMaker.make[DuplicatedNamed](CodecMakerConfig())""".stripMargin
}).getMessage.contains {
"""Duplicated 'com.github.plokhotnyuk.jsoniter_scala.macros.named'
|defined for 'z' of 'DuplicatedNamed'.""".stripMargin.replace('\n', ' ')
})