From f3883ba23ac7fb7488ff1fbdf2041b6ad0a22dc2 Mon Sep 17 00:00:00 2001 From: David Denton Date: Thu, 4 Jan 2024 17:21:45 +0000 Subject: [PATCH] add support for mapped lists --- .../test/kotlin/dev/forkhandles/lens/DataContainerContract.kt | 2 +- .../kotlin/dev/forkhandles/lens/JacksonDataContainerTest.kt | 2 +- .../test/kotlin/dev/forkhandles/lens/MapDataContainerTest.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/data4k/src/test/kotlin/dev/forkhandles/lens/DataContainerContract.kt b/data4k/src/test/kotlin/dev/forkhandles/lens/DataContainerContract.kt index 55c267f..5aa72c6 100644 --- a/data4k/src/test/kotlin/dev/forkhandles/lens/DataContainerContract.kt +++ b/data4k/src/test/kotlin/dev/forkhandles/lens/DataContainerContract.kt @@ -113,7 +113,7 @@ abstract class DataContainerContract { expectSetWorks(input::optionalField, "123123") expectSetWorks(input::optionalField, null) -// expectThat(input::mappedField, 123) + expectSetWorks(input::mappedField, 123) } @Test diff --git a/data4k/src/test/kotlin/dev/forkhandles/lens/JacksonDataContainerTest.kt b/data4k/src/test/kotlin/dev/forkhandles/lens/JacksonDataContainerTest.kt index b05d344..edf8e9b 100644 --- a/data4k/src/test/kotlin/dev/forkhandles/lens/JacksonDataContainerTest.kt +++ b/data4k/src/test/kotlin/dev/forkhandles/lens/JacksonDataContainerTest.kt @@ -26,7 +26,7 @@ class JacksonDataContainerTest : DataContainerContract? by list() override var optionalObjectField by obj(::SubNodeBacked) diff --git a/data4k/src/test/kotlin/dev/forkhandles/lens/MapDataContainerTest.kt b/data4k/src/test/kotlin/dev/forkhandles/lens/MapDataContainerTest.kt index c544891..9b1e5ce 100644 --- a/data4k/src/test/kotlin/dev/forkhandles/lens/MapDataContainerTest.kt +++ b/data4k/src/test/kotlin/dev/forkhandles/lens/MapDataContainerTest.kt @@ -17,7 +17,7 @@ class MapDataContainerTest : DataContainerContract( override var decimalField by field() override var notAStringField by field() - override var mappedField by field(String::toInt) + override var mappedField by field(String::toInt, Int::toString) override var listField by list() override var listValueField by list(MyType)