-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for steps.annotation.toString
- Loading branch information
1 parent
8bbb7e5
commit a9cc783
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package steps.annotation | ||
|
||
import scala.annotation.experimental | ||
import scala.language.experimental.clauseInterleaving | ||
|
||
@toString | ||
@experimental | ||
class Foo1(val a: Int, val b: String) | ||
|
||
@toString | ||
@experimental | ||
class Foo2(a: Int, b: String) | ||
|
||
@toString | ||
@experimental | ||
class Foo3(var a: Int, var b: String) | ||
|
||
@toString | ||
@experimental | ||
class Foo4(a: Int, b: String)(c: Int) | ||
|
||
@experimental | ||
class AssertToStringBehaviour extends munit.FunSuite: | ||
|
||
test("@toString works with all kinds of classes"): | ||
assertEquals(Foo1(1, "hello").toString(), "Foo1(1, hello)") | ||
assertEquals(Foo2(1, "hello").toString(), "Foo2(1, hello)") | ||
assertEquals(Foo3(1, "hello").toString(), "Foo3(1, hello)") | ||
assertEquals(Foo4(1, "hello")(2).toString(), "Foo4(1, hello, 2)") | ||
|
||
end AssertToStringBehaviour |