Last active
November 6, 2025 15:49
-
-
Save zainab-ali/97456a9054a7eb35a8dd6499a81d6c19 to your computer and use it in GitHub Desktop.
Demonstrates better diffs using multi-line strings.
This file contains hidden or 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
| //> using scala 3.7.3 | |
| //> using repository ivy2Local | |
| //> using dep "org.typelevel::weaver-cats::0.10.1" | |
| import weaver.* | |
| case class Address(country: String, city: String) | |
| case class Person(address: Address) | |
| val expected = List( | |
| Person(Address("UK", "London")), | |
| Person(Address("UK", "Birmingham")), | |
| Person(Address("UK", "Manchester")), | |
| Person(Address("UK", "Edinburgh")), | |
| Person(Address("UK", "Plymouth")), | |
| Person(Address("France", "Paris")), | |
| Person(Address("France", "Lyon")), | |
| Person(Address("France", "Nice")), | |
| Person(Address("France", "Nantes")) | |
| ) | |
| val found = List( | |
| Person(Address("UK", "London")), | |
| Person(Address("UK", "Birmingham")), | |
| Person(Address("UK", "Manchester")), | |
| Person(Address("UK", "Edinburgh")), | |
| Person(Address("UK", "Weymouth")), | |
| Person(Address("France", "Paris")), | |
| Person(Address("France", "Lyon")), | |
| Person(Address("France", "Nice")), | |
| Person(Address("France", "Nantes")) | |
| ) | |
| object DiffTest extends SimpleIOSuite { | |
| pureTest("diff") { | |
| expect.same(expected, found) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment