From 829458fbfac6b9332e124d4b78ee5731dd687bbd Mon Sep 17 00:00:00 2001 From: KolbyRKunz Date: Mon, 30 Oct 2023 10:41:55 -0600 Subject: [PATCH] feat: working tests Signed-off-by: KolbyRKunz --- .../commonMain/kotlin/aries_askar/AskarEntry.kt | 2 ++ wrappers/kotlin/build.gradle.kts | 6 +++--- wrappers/kotlin/src/commonTest/kotlin/AskarTest.kt | 6 ++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/wrappers/kotlin/askarBindings/commonMain/kotlin/aries_askar/AskarEntry.kt b/wrappers/kotlin/askarBindings/commonMain/kotlin/aries_askar/AskarEntry.kt index 994b35ab..ffd8010c 100644 --- a/wrappers/kotlin/askarBindings/commonMain/kotlin/aries_askar/AskarEntry.kt +++ b/wrappers/kotlin/askarBindings/commonMain/kotlin/aries_askar/AskarEntry.kt @@ -49,6 +49,8 @@ class AskarEntry( UniFFILib.uniffi_aries_askar_fn_method_askarentry_tags(it, _status) } }.let { + for( i in 0 until it.dataSize) { + } FfiConverterMapStringString.lift(it) } diff --git a/wrappers/kotlin/build.gradle.kts b/wrappers/kotlin/build.gradle.kts index a9ec0f77..582914c7 100644 --- a/wrappers/kotlin/build.gradle.kts +++ b/wrappers/kotlin/build.gradle.kts @@ -137,9 +137,9 @@ kotlin { jvm{ compilations.all{ kotlinOptions.jvmTarget = "1.8" -// this.kotlinOptions { -// freeCompilerArgs += listOf("-Xdebug") -// } + this.kotlinOptions { + freeCompilerArgs += listOf("-Xdebug") + } } testRuns["test"].executionTask.configure{ useJUnitPlatform() diff --git a/wrappers/kotlin/src/commonTest/kotlin/AskarTest.kt b/wrappers/kotlin/src/commonTest/kotlin/AskarTest.kt index f95e6992..f7cd998a 100644 --- a/wrappers/kotlin/src/commonTest/kotlin/AskarTest.kt +++ b/wrappers/kotlin/src/commonTest/kotlin/AskarTest.kt @@ -7,7 +7,7 @@ import askar.store.Store import askar.toUbyteList import kotlinx.coroutines.runBlocking import kotlinx.serialization.encodeToString -import kotlinx.serialization.json.Json +import kotlinx.serialization.json.* import kotlin.test.* import kotlin.test.Test @@ -242,7 +242,9 @@ class AskarTest { tags = Json.encodeToString(firstEntry.tags) ) - assertEquals(1, txn.count(firstEntry.category, Json.encodeToString(firstEntry.tags))) + val count = txn.count(firstEntry.category, Json.encodeToString(firstEntry.tags)) + + assertEquals(1, count) val ret = txn.fetch(firstEntry.category, firstEntry.name) ?: throw Error("should not happen")