diff --git a/.codecov.yml b/.codecov.yml index bd48e50d4d319190edb439636d2c10a7f186e9f6..ab8fb39507f2a4e8b1c613d94079dd64e2278ef3 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -13,5 +13,5 @@ comment: behavior: default ignore: - - "package.scala" - - "macros.scala" \ No newline at end of file + - "src/main/scala/io/github/dreamylost/package.scala" + - "src/main/scala/io/github/dreamylost/macros/macros.scala" \ No newline at end of file diff --git a/src/test/scala/io/github/dreamylost/ConstructorTest.scala b/src/test/scala/io/github/dreamylost/ConstructorTest.scala index 7bc94ecdf9e936b6a85f1cdfae4d033aaee096f5..224eeacb3934e2e6792f950fedeb5b034950f32e 100644 --- a/src/test/scala/io/github/dreamylost/ConstructorTest.scala +++ b/src/test/scala/io/github/dreamylost/ConstructorTest.scala @@ -34,7 +34,7 @@ class ConstructorTest extends AnyFlatSpec with Matchers { "constructor1" should "failed" in { """ @constructor - | object A2 { + | case class A2() { | private val a: Int = 1 | var b: Int = 1 | def helloWorld: String = "hello world" diff --git a/src/test/scala/io/github/dreamylost/EqualsAndHashCodeTest.scala b/src/test/scala/io/github/dreamylost/EqualsAndHashCodeTest.scala index c49db7ca15e851b86c848c307f41cf2586efba13..c2bd45c64b10866f491f1dd5ca42a192c9dbefae 100644 --- a/src/test/scala/io/github/dreamylost/EqualsAndHashCodeTest.scala +++ b/src/test/scala/io/github/dreamylost/EqualsAndHashCodeTest.scala @@ -128,7 +128,7 @@ class EqualsAndHashCodeTest extends AnyFlatSpec with Matchers { def hello: String = ??? } """ - | @equalsAndHashCode + | @equalsAndHashCode(excludeFields = Nil) | class Employee4(name: String, age: Int, var role: String) extends Person(name, age) { | val i = 0 | def hello: String = ??? @@ -146,9 +146,23 @@ class EqualsAndHashCodeTest extends AnyFlatSpec with Matchers { |""".stripMargin shouldNot compile """ - | @equalsAndHashCode(verbose = true, excludeFields = Seq("i")) - | class Employee4(name: String, age: Int, var role: String) extends Person(name, age) { + | @equalsAndHashCode(verbose = true, excludeFields = Seq("i", "j", "k", "t")) + | class Employee5(name: String, age: Int, var role: String) extends Person(name, age) { + | val i = 0 + | var j = 0 + | val k: Int = 1 + | var t: Int = 2 + | def hello: String = ??? + | } + |""".stripMargin should compile + + """ + | @equalsAndHashCode(verbose = true, excludeFields = Nil) + | class Employee6(name: String, age: Int, var role: String) extends Person(name, age) { | val i = 0 + | var j = 0 + | val k: Int = 1 + | var t: Int = 2 | def hello: String = ??? | } |""".stripMargin should compile diff --git a/src/test/scala/io/github/dreamylost/ToStringTest.scala b/src/test/scala/io/github/dreamylost/ToStringTest.scala index 2bda7a3414674edcfa165d3ba0edda7f41eb9e38..43fd689a62c06ebd196cc88d83632fce030e53f5 100644 --- a/src/test/scala/io/github/dreamylost/ToStringTest.scala +++ b/src/test/scala/io/github/dreamylost/ToStringTest.scala @@ -293,6 +293,8 @@ class ToStringTest extends AnyFlatSpec with Matchers { | import io.github.dreamylost.logs.LogType | @toString(includeFieldNames = false, callSuper = true, verbose = true) | class TestClass6(val i: Int = 0, var j: Int) + | + | @toString(verbose = false, includeFieldNames = false) class TestClass6(val i: Int = 0, var j: Int) |""".stripMargin shouldNot compile }