Skip to content

Commit 880f121

Browse files
committed
Port all tests from kotlintest to kotest
1 parent b6f913f commit 880f121

24 files changed

+88
-92
lines changed

build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ repositories {
1111
dependencies {
1212
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2")
1313

14-
testImplementation("io.kotlintest:kotlintest-runner-junit5:3.4.2")
1514
testImplementation("io.kotest:kotest-runner-junit5:6.0.0.M4")
1615
testImplementation("org.assertj:assertj-core:3.27.3")
1716
testImplementation("ch.qos.logback:logback-classic:1.5.18")

src/test/kotlin/de/ronny_h/aoc/extensions/CombinationsTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package de.ronny_h.aoc.extensions
22

3-
import io.kotlintest.shouldBe
4-
import io.kotlintest.specs.StringSpec
3+
import io.kotest.core.spec.style.StringSpec
4+
import io.kotest.matchers.shouldBe
55

66
class CombinationsTest : StringSpec({
77

src/test/kotlin/de/ronny_h/aoc/extensions/CoordinatesTest.kt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
package de.ronny_h.aoc.extensions
22

33
import de.ronny_h.aoc.extensions.Direction.*
4-
import io.kotlintest.data.forall
5-
import io.kotlintest.matchers.collections.shouldContainAll
6-
import io.kotlintest.shouldBe
7-
import io.kotlintest.specs.StringSpec
8-
import io.kotlintest.tables.row
4+
import io.kotest.matchers.shouldBe
5+
import io.kotest.core.spec.style.StringSpec
6+
import io.kotest.data.forAll
7+
import io.kotest.data.row
8+
import io.kotest.matchers.collections.shouldContainAll
99

1010

1111
class CoordinatesTest : StringSpec({
1212

1313
"Coordinates are added" {
14-
forall(
14+
forAll(
1515
row(Coordinates(1, 1), Coordinates(0, 0), Coordinates(1, 1)),
1616
row(Coordinates(0, 0), Coordinates(1, 1), Coordinates(1, 1)),
1717
row(Coordinates(1, 2), Coordinates(3, 4), Coordinates(4, 6)),
@@ -21,7 +21,7 @@ class CoordinatesTest : StringSpec({
2121
}
2222

2323
"Coordinates are subtracted" {
24-
forall(
24+
forAll(
2525
row(Coordinates(1, 1), Coordinates(0, 0), Coordinates(1, 1)),
2626
row(Coordinates(0, 0), Coordinates(1, 1), Coordinates(-1, -1)),
2727
row(Coordinates(3, 5), Coordinates(2, 1), Coordinates(1, 4)),
@@ -31,7 +31,7 @@ class CoordinatesTest : StringSpec({
3131
}
3232

3333
"Multiplication with a scalar" {
34-
forall(
34+
forAll(
3535
row(0, Coordinates(5, 7), Coordinates(0, 0)),
3636
row(7, Coordinates(0, 0), Coordinates(0, 0)),
3737
row(3, Coordinates(5, 7), Coordinates(15, 21)),
@@ -43,7 +43,7 @@ class CoordinatesTest : StringSpec({
4343
}
4444

4545
"Add a direction" {
46-
forall(
46+
forAll(
4747
row(Coordinates(5, 5), NORTH, Coordinates(4, 5)),
4848
row(Coordinates(5, 5), SOUTH, Coordinates(6, 5)),
4949
row(Coordinates(5, 5), EAST, Coordinates(5, 6)),

src/test/kotlin/de/ronny_h/aoc/extensions/GridTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package de.ronny_h.aoc.extensions
22

33
import com.github.stefanbirkner.systemlambda.SystemLambda.tapSystemOut
4-
import io.kotlintest.shouldBe
5-
import io.kotlintest.shouldNotBe
6-
import io.kotlintest.specs.StringSpec
4+
import io.kotest.core.spec.style.StringSpec
5+
import io.kotest.matchers.shouldBe
6+
import io.kotest.matchers.shouldNotBe
77

88
class GridTest : StringSpec() {
99

src/test/kotlin/de/ronny_h/aoc/extensions/MemoizeTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package de.ronny_h.aoc.extensions
22

3-
import io.kotlintest.shouldBe
4-
import io.kotlintest.specs.StringSpec
3+
import io.kotest.core.spec.style.StringSpec
4+
import io.kotest.matchers.shouldBe
55

66
class MemoizeTest : StringSpec({
77

src/test/kotlin/de/ronny_h/aoc/extensions/PrefixTreeTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package de.ronny_h.aoc.extensions
22

3-
import io.kotlintest.shouldBe
4-
import io.kotlintest.specs.StringSpec
3+
import io.kotest.core.spec.style.StringSpec
4+
import io.kotest.matchers.shouldBe
55

66
class PrefixTreeTest : StringSpec({
77

@@ -20,12 +20,12 @@ class PrefixTreeTest : StringSpec({
2020
tree.insert("abc", listOf("a", "b", "c")) shouldBe 1
2121
}
2222

23-
"a word consisting with a missing token can not be inserted" {
23+
"a word with a missing token can not be inserted" {
2424
val tree = PrefixTree()
2525
tree.insert("abc", listOf("a", "c")) shouldBe 0
2626
}
2727

28-
"a word constructed from token of different lengths can be inserted once" {
28+
"a word constructed from tokens of different lengths can be inserted once" {
2929
val tree = PrefixTree()
3030
tree.insert("abc", listOf("ab", "c")) shouldBe 1
3131
}

src/test/kotlin/de/ronny_h/aoc/extensions/ShortestPathTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package de.ronny_h.aoc.extensions
22

3-
import io.kotlintest.shouldBe
4-
import io.kotlintest.specs.StringSpec
3+
import io.kotest.core.spec.style.StringSpec
4+
import io.kotest.matchers.shouldBe
55

66
typealias At = Coordinates
77

src/test/kotlin/de/ronny_h/aoc/extensions/SymmetriesTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package de.ronny_h.aoc.extensions
22

3-
import io.kotlintest.shouldBe
4-
import io.kotlintest.specs.StringSpec
3+
import io.kotest.core.spec.style.StringSpec
4+
import io.kotest.matchers.shouldBe
55

66
class SymmetriesTest : StringSpec({
77

src/test/kotlin/de/ronny_h/aoc/year24/day01/HistorianHysteriaTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package de.ronny_h.aoc.year24.day01
22

33
import de.ronny_h.aoc.extensions.asList
4-
import io.kotlintest.shouldBe
5-
import io.kotlintest.specs.StringSpec
4+
import io.kotest.core.spec.style.StringSpec
5+
import io.kotest.matchers.shouldBe
66

77
class HistorianHysteriaTest : StringSpec({
88
val smallInput = """

src/test/kotlin/de/ronny_h/aoc/year24/day02/RedNosedReportsTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package de.ronny_h.aoc.year24.day02
22

33
import de.ronny_h.aoc.extensions.asList
4-
import io.kotlintest.shouldBe
5-
import io.kotlintest.specs.StringSpec
4+
import io.kotest.core.spec.style.StringSpec
5+
import io.kotest.matchers.shouldBe
66

77
class RedNosedReportsTest : StringSpec({
88
val smallReports1 = listOf("5 4 5", "1 2 3", "1 1 2", "1 5 6", "7 6 5")

0 commit comments

Comments
 (0)