From 625428c218d00b0a5a0afb698af87866d6d39124 Mon Sep 17 00:00:00 2001 From: David Vega Lichacz <7826728+realdavidvega@users.noreply.github.com> Date: Thu, 30 May 2024 20:00:09 +0200 Subject: [PATCH] test: ignore tokenizer tests on native (#749) --- .../kotlin/com/xebia/functional/tokenizer/O200kBaseTest.kt | 2 ++ .../kotlin/com/xebia/functional/tokenizer/predef.kt | 3 +++ .../jsTest/kotlin/com/xebia/functional/tokenizer/predef.kt | 4 ++++ .../jvmTest/kotlin/com/xebia/functional/tokenizer/predef.kt | 4 ++++ .../kotlin/com/xebia/functional/tokenizer/predef.kt | 3 +++ 5 files changed, 16 insertions(+) create mode 100644 tokenizer/src/jsTest/kotlin/com/xebia/functional/tokenizer/predef.kt create mode 100644 tokenizer/src/jvmTest/kotlin/com/xebia/functional/tokenizer/predef.kt create mode 100644 tokenizer/src/nativeTest/kotlin/com/xebia/functional/tokenizer/predef.kt diff --git a/tokenizer/src/commonTest/kotlin/com/xebia/functional/tokenizer/O200kBaseTest.kt b/tokenizer/src/commonTest/kotlin/com/xebia/functional/tokenizer/O200kBaseTest.kt index f6b2e604e..32e6afe37 100644 --- a/tokenizer/src/commonTest/kotlin/com/xebia/functional/tokenizer/O200kBaseTest.kt +++ b/tokenizer/src/commonTest/kotlin/com/xebia/functional/tokenizer/O200kBaseTest.kt @@ -6,6 +6,8 @@ import io.kotest.matchers.shouldBe import io.kotest.matchers.string.shouldStartWith import kotlin.test.Test +// Ignore test on native since not all characters can be encoded +@IgnoreOnNative class O200kBaseTest { private val resource = Resource("src/commonTest/resources/o200k_base_encodings.csv") private val ENCODING = O200K_BASE.encoding diff --git a/tokenizer/src/commonTest/kotlin/com/xebia/functional/tokenizer/predef.kt b/tokenizer/src/commonTest/kotlin/com/xebia/functional/tokenizer/predef.kt index 6d8a55c1f..795aeff90 100644 --- a/tokenizer/src/commonTest/kotlin/com/xebia/functional/tokenizer/predef.kt +++ b/tokenizer/src/commonTest/kotlin/com/xebia/functional/tokenizer/predef.kt @@ -53,3 +53,6 @@ fun String.parseEncoding(): List = .split(",") .dropLastWhile { it.isEmpty() } .map { it.toInt() } + +@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) +expect annotation class IgnoreOnNative() diff --git a/tokenizer/src/jsTest/kotlin/com/xebia/functional/tokenizer/predef.kt b/tokenizer/src/jsTest/kotlin/com/xebia/functional/tokenizer/predef.kt new file mode 100644 index 000000000..53eb1da20 --- /dev/null +++ b/tokenizer/src/jsTest/kotlin/com/xebia/functional/tokenizer/predef.kt @@ -0,0 +1,4 @@ +package com.xebia.functional.tokenizer + +@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) +actual annotation class IgnoreOnNative diff --git a/tokenizer/src/jvmTest/kotlin/com/xebia/functional/tokenizer/predef.kt b/tokenizer/src/jvmTest/kotlin/com/xebia/functional/tokenizer/predef.kt new file mode 100644 index 000000000..53eb1da20 --- /dev/null +++ b/tokenizer/src/jvmTest/kotlin/com/xebia/functional/tokenizer/predef.kt @@ -0,0 +1,4 @@ +package com.xebia.functional.tokenizer + +@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) +actual annotation class IgnoreOnNative diff --git a/tokenizer/src/nativeTest/kotlin/com/xebia/functional/tokenizer/predef.kt b/tokenizer/src/nativeTest/kotlin/com/xebia/functional/tokenizer/predef.kt new file mode 100644 index 000000000..0626c2e16 --- /dev/null +++ b/tokenizer/src/nativeTest/kotlin/com/xebia/functional/tokenizer/predef.kt @@ -0,0 +1,3 @@ +package com.xebia.functional.tokenizer + +actual typealias IgnoreOnNative = kotlin.test.Ignore