Skip to content

Commit 698cc39

Browse files
committed
Merge branch 'main' into gradle-9
# Conflicts: # build.gradle.kts # gradle/libs.versions.toml # gradle/wrapper/gradle-wrapper.properties
2 parents e67bc35 + 11e2d4e commit 698cc39

File tree

13 files changed

+100
-20
lines changed

13 files changed

+100
-20
lines changed

gradle/libs.versions.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ arrow = "2.1.2"
44
assertj = "3.27.3"
55
dependencyAnalysis-gradlePlugin = "2.19.0"
66
detekt = "1.23.8"
7-
equalsverifier = "4.0.4"
7+
equalsverifier = "4.0.7"
88
jetbrains-annotations = "26.0.2"
9-
junit = "5.13.3"
9+
junit = "5.13.4"
1010
jvmDependencyConflictResolution-gradlePlugin = "2.4"
1111
koin = "4.1.0"
1212
kotest = "5.9.1"
@@ -17,7 +17,7 @@ kotlinx-dl = "0.5.2"
1717
ksp = "2.2.0-2.0.2" # Must match Kotlin version above.
1818
mockito = "5.18.0"
1919
mockito-kotlin = "2.2.0"
20-
mockk = "1.14.2"
20+
mockk = "1.14.5"
2121
mokkery = "2.9.0"
2222
org-json = "20250517"
2323
slf4j = "2.0.17"

subprojects/equalsverifier-with-kotlin/src/main/kotlin/org/sdkotlin/equalsverifier/delegation/DelegatedEquals.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,9 @@ class FooBarImpl(barValue: Int) : Foo, Bar by BarImpl(barValue) {
2323
override fun hashCode(): Int = bar
2424
override fun toString(): String = "FooBarImpl(foo=$bar)"
2525
}
26+
27+
interface Baz {
28+
val bar: Bar
29+
}
30+
31+
data class BazImpl(override val bar: Bar) : Baz
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package org.sdkotlin.equalsverifier.delegation
2+
3+
interface LazyEquals {
4+
val foo: Int
5+
val bar: String
6+
}
7+
8+
class LazyEqualsImpl(foo: Int, bar: String) : LazyEquals {
9+
10+
override val foo: Int by lazy { foo }
11+
override val bar: String by lazy { bar }
12+
13+
override fun equals(other: Any?) =
14+
other is LazyEqualsImpl && other.foo == foo && other.bar == bar
15+
16+
override fun hashCode() = foo.hashCode() + 31 * bar.hashCode()
17+
override fun toString() = "LazyEqualsImpl(foo=$foo, bar=$bar)"
18+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package org.sdkotlin.equalsverifier.delegation
2+
3+
import nl.jqno.equalsverifier.EqualsVerifier
4+
import org.junit.jupiter.api.Test
5+
6+
class BarImplTest {
7+
8+
@Test
9+
fun `test equals, hashCode, and toString`() {
10+
11+
EqualsVerifier.forClass(BarImpl::class.java).verify()
12+
}
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package org.sdkotlin.equalsverifier.delegation
2+
3+
import nl.jqno.equalsverifier.EqualsVerifier
4+
import org.junit.jupiter.api.Test
5+
6+
class BazImplTest {
7+
8+
@Test
9+
fun `test equals, hashCode, and toString`() {
10+
11+
EqualsVerifier.forClass(BazImpl::class.java).verify()
12+
}
13+
}

subprojects/equalsverifier-with-kotlin/src/test/kotlin/org/sdkotlin/equalsverifier/delegation/FooBarImplTest.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.sdkotlin.equalsverifier.delegation
22

33
import nl.jqno.equalsverifier.EqualsVerifier
4+
import nl.jqno.equalsverifier.Mode
45
import org.assertj.core.api.Assertions.assertThat
56
import org.junit.jupiter.api.Test
67

@@ -11,8 +12,10 @@ class FooBarImplTest {
1112

1213
EqualsVerifier.forClass(FooBarImpl::class.java)
1314
.withIgnoredFields(Foo::foo.name)
14-
// Required per https://github.com/jqno/equalsverifier/issues/1083.
15-
.withPrefabValues(BarImpl::class.java, BarImpl(1), BarImpl(2))
15+
// Mockito skip or prefab values required per
16+
// https://github.com/jqno/equalsverifier/issues/1083.
17+
.set(Mode.skipMockito())
18+
//.withPrefabValues(BarImpl::class.java, BarImpl(1), BarImpl(2))
1619
.verify()
1720
}
1821

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package org.sdkotlin.equalsverifier.delegation
2+
3+
import nl.jqno.equalsverifier.EqualsVerifier
4+
import org.junit.jupiter.api.Test
5+
6+
class LazyEqualsImplTest {
7+
8+
@Test
9+
fun `test equals, hashCode, and toString`() {
10+
11+
EqualsVerifier
12+
// Required per https://github.com/jqno/equalsverifier/issues/1097
13+
.forExamples(LazyEqualsImpl(1, "red"), LazyEqualsImpl(2, "blue"))
14+
.verify()
15+
}
16+
}

subprojects/kotlin-for-java-devs/src/main/kotlin/org/sdkotlin/meetup/firstwednesday/SDKotlin.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1+
2+
3+
4+
5+
6+
7+
18
package org.sdkotlin.meetup.firstwednesday
29

310
import java.time.DayOfWeek.WEDNESDAY
411
import java.time.LocalDate.now
512
import java.time.temporal.TemporalAdjusters.dayOfWeekInMonth
613

714
fun firstWednesday() =
8-
now() == now().with(dayOfWeekInMonth(1, WEDNESDAY))
15+
now().equals(now().with(dayOfWeekInMonth(1, WEDNESDAY)))
916

1017
fun main() {
1118
when {
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package org.sdkotlin.testing.mokkery
2+
3+
@Suppress("unused") // Not mockable by Mokkery unless all-opened.
4+
data class DataClass(
5+
override val v: ValueClassSuperType,
6+
) : DataClassSuperType
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package org.sdkotlin.testing.mokkery
2+
3+
interface DataClassSuperType {
4+
val v: ValueClassSuperType
5+
}

0 commit comments

Comments
 (0)