From ee8a80a0b18dfccaf44566e46ac51af70c5c0e62 Mon Sep 17 00:00:00 2001 From: AJ Date: Thu, 25 Jan 2024 11:21:43 -0800 Subject: [PATCH] Add wasm target --- .github/workflows/publish.yml | 19 ++++---- .github/workflows/test.yml | 21 +++++---- README.md | 8 ++-- colormath/build.gradle.kts | 4 +- .../ajalt/colormath/internal/MatrixTest.kt | 7 ++- gradle/libs.versions.toml | 6 +-- settings.gradle.kts | 1 + test/build.gradle.kts | 46 +++++++++++++++++++ test/gradle.properties | 2 + .../github/ajalt/colormath/CssParseTest.kt | 0 .../github/ajalt/colormath/CssRenderTest.kt | 0 .../github/ajalt/colormath/HueColorTest.kt | 0 .../com/github/ajalt/colormath/TestUtils.kt | 0 .../ajalt/colormath/calculate/ContrastTest.kt | 0 .../colormath/calculate/DifferenceTest.kt | 0 .../ajalt/colormath/calculate/GamutTest.kt | 0 .../ajalt/colormath/model/Ansi16Test.kt | 0 .../ajalt/colormath/model/Ansi256Test.kt | 0 .../github/ajalt/colormath/model/CMYKTest.kt | 0 .../github/ajalt/colormath/model/HPLuvTest.kt | 0 .../github/ajalt/colormath/model/HSLTest.kt | 0 .../github/ajalt/colormath/model/HSLuvTest.kt | 0 .../github/ajalt/colormath/model/HSVTest.kt | 0 .../github/ajalt/colormath/model/HWBTest.kt | 0 .../github/ajalt/colormath/model/ICtCpTest.kt | 0 .../ajalt/colormath/model/JzAzBzTest.kt | 0 .../ajalt/colormath/model/JzCzHzTest.kt | 0 .../github/ajalt/colormath/model/LABTest.kt | 0 .../github/ajalt/colormath/model/LCHabTest.kt | 0 .../github/ajalt/colormath/model/LCHuvTest.kt | 0 .../github/ajalt/colormath/model/LUVTest.kt | 0 .../github/ajalt/colormath/model/OklabTest.kt | 0 .../github/ajalt/colormath/model/OklchTest.kt | 0 .../model/RGBColorSpacesConversionTest.kt | 0 .../RGBColorSpacesTransferFunctionsTest.kt | 0 .../ajalt/colormath/model/RGBIntTest.kt | 0 .../github/ajalt/colormath/model/RGBTest.kt | 0 .../github/ajalt/colormath/model/XYZTest.kt | 13 +++--- .../transform/EasingFunctionsTest.kt | 0 .../colormath/transform/HueAdjustmentsTest.kt | 0 .../colormath/transform/InterpolateTest.kt | 0 .../colormath/transform/TransformTest.kt | 0 42 files changed, 96 insertions(+), 31 deletions(-) create mode 100644 test/build.gradle.kts create mode 100644 test/gradle.properties rename {colormath => test}/src/commonTest/kotlin/com/github/ajalt/colormath/CssParseTest.kt (100%) rename {colormath => test}/src/commonTest/kotlin/com/github/ajalt/colormath/CssRenderTest.kt (100%) rename {colormath => test}/src/commonTest/kotlin/com/github/ajalt/colormath/HueColorTest.kt (100%) rename {colormath => test}/src/commonTest/kotlin/com/github/ajalt/colormath/TestUtils.kt (100%) rename {colormath => test}/src/commonTest/kotlin/com/github/ajalt/colormath/calculate/ContrastTest.kt (100%) rename {colormath => test}/src/commonTest/kotlin/com/github/ajalt/colormath/calculate/DifferenceTest.kt (100%) rename {colormath => test}/src/commonTest/kotlin/com/github/ajalt/colormath/calculate/GamutTest.kt (100%) rename {colormath => test}/src/commonTest/kotlin/com/github/ajalt/colormath/model/Ansi16Test.kt (100%) rename {colormath => test}/src/commonTest/kotlin/com/github/ajalt/colormath/model/Ansi256Test.kt (100%) rename {colormath => test}/src/commonTest/kotlin/com/github/ajalt/colormath/model/CMYKTest.kt (100%) rename {colormath => test}/src/commonTest/kotlin/com/github/ajalt/colormath/model/HPLuvTest.kt (100%) rename {colormath => test}/src/commonTest/kotlin/com/github/ajalt/colormath/model/HSLTest.kt (100%) rename {colormath => test}/src/commonTest/kotlin/com/github/ajalt/colormath/model/HSLuvTest.kt (100%) rename {colormath => test}/src/commonTest/kotlin/com/github/ajalt/colormath/model/HSVTest.kt (100%) rename {colormath => test}/src/commonTest/kotlin/com/github/ajalt/colormath/model/HWBTest.kt (100%) rename {colormath => test}/src/commonTest/kotlin/com/github/ajalt/colormath/model/ICtCpTest.kt (100%) rename {colormath => test}/src/commonTest/kotlin/com/github/ajalt/colormath/model/JzAzBzTest.kt (100%) rename {colormath => test}/src/commonTest/kotlin/com/github/ajalt/colormath/model/JzCzHzTest.kt (100%) rename {colormath => test}/src/commonTest/kotlin/com/github/ajalt/colormath/model/LABTest.kt (100%) rename {colormath => test}/src/commonTest/kotlin/com/github/ajalt/colormath/model/LCHabTest.kt (100%) rename {colormath => test}/src/commonTest/kotlin/com/github/ajalt/colormath/model/LCHuvTest.kt (100%) rename {colormath => test}/src/commonTest/kotlin/com/github/ajalt/colormath/model/LUVTest.kt (100%) rename {colormath => test}/src/commonTest/kotlin/com/github/ajalt/colormath/model/OklabTest.kt (100%) rename {colormath => test}/src/commonTest/kotlin/com/github/ajalt/colormath/model/OklchTest.kt (100%) rename {colormath => test}/src/commonTest/kotlin/com/github/ajalt/colormath/model/RGBColorSpacesConversionTest.kt (100%) rename {colormath => test}/src/commonTest/kotlin/com/github/ajalt/colormath/model/RGBColorSpacesTransferFunctionsTest.kt (100%) rename {colormath => test}/src/commonTest/kotlin/com/github/ajalt/colormath/model/RGBIntTest.kt (100%) rename {colormath => test}/src/commonTest/kotlin/com/github/ajalt/colormath/model/RGBTest.kt (100%) rename {colormath => test}/src/commonTest/kotlin/com/github/ajalt/colormath/model/XYZTest.kt (86%) rename {colormath => test}/src/commonTest/kotlin/com/github/ajalt/colormath/transform/EasingFunctionsTest.kt (100%) rename {colormath => test}/src/commonTest/kotlin/com/github/ajalt/colormath/transform/HueAdjustmentsTest.kt (100%) rename {colormath => test}/src/commonTest/kotlin/com/github/ajalt/colormath/transform/InterpolateTest.kt (100%) rename {colormath => test}/src/commonTest/kotlin/com/github/ajalt/colormath/transform/TransformTest.kt (100%) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c6f5649b..d8d8c3fe 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -16,16 +16,17 @@ jobs: - uses: actions/setup-java@v3 with: distribution: 'zulu' - java-version: 20 + java-version: 21 - uses: gradle/gradle-build-action@v2 with: arguments: | - :colormath:jsNodeTest - :colormath:jvmTest - :colormath:linuxX64Test + :test:jsNodeTest + :test:jvmTest + :test:linuxX64Test :colormath:compileKotlinLinuxArm64 - :extensions:colormath-ext-jetpack-compose:check - :extensions:colormath-ext-android-colorint:check + :colormath:wasmJsTest + :extensions:colormath-ext-jetpack-compose:check + :extensions:colormath-ext-android-colorint:check :extensions:colormath-ext-android-color:check --stacktrace - name: Bundle the build report @@ -44,7 +45,7 @@ jobs: - uses: actions/setup-java@v3 with: distribution: 'zulu' - java-version: 20 + java-version: 21 - uses: gradle/gradle-build-action@v2 with: arguments: | @@ -63,7 +64,7 @@ jobs: - uses: actions/setup-java@v3 with: distribution: 'zulu' - java-version: 20 + java-version: 21 - uses: gradle/gradle-build-action@v2 with: arguments: mingwX64Test --stacktrace @@ -76,7 +77,7 @@ jobs: - uses: actions/setup-java@v3 with: distribution: 'zulu' - java-version: 20 + java-version: 21 - name: Fetch git tags run: git fetch origin +refs/tags/*:refs/tags/* - name: Deploy to sonatype diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c6f5e218..98f05b49 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,17 +14,19 @@ jobs: - uses: actions/setup-java@v3 with: distribution: 'zulu' - java-version: 20 + java-version: 21 - uses: gradle/gradle-build-action@v2 with: arguments: | - :colormath:jsNodeTest - :colormath:jvmTest - :colormath:linuxX64Test + :test:jsNodeTest + :test:jvmTest + :test:linuxX64Test :colormath:compileKotlinLinuxArm64 + :colormath:wasmJsTest :extensions:colormath-ext-jetpack-compose:check :extensions:colormath-ext-android-colorint:check - :extensions:colormath-ext-android-color:check --stacktrace + :extensions:colormath-ext-android-color:check + --stacktrace - name: Bundle the build report if: failure() run: find . -type d -name 'reports' | zip -@ -r build-reports.zip @@ -41,14 +43,17 @@ jobs: - uses: actions/setup-java@v3 with: distribution: 'zulu' - java-version: 20 + java-version: 21 - uses: gradle/gradle-build-action@v2 with: arguments: | macosX64Test :colormath:compileKotlinMacosArm64 - tvosX64Test iosX64Test + tvosX64Test + iosSimulatorArm64Test + tvosSimulatorArm64Test + watchosSimulatorArm64Test --stacktrace windows-tests: runs-on: windows-latest @@ -57,7 +62,7 @@ jobs: - uses: actions/setup-java@v3 with: distribution: 'zulu' - java-version: 20 + java-version: 21 - uses: gradle/gradle-build-action@v2 with: arguments: mingwX64Test --stacktrace diff --git a/README.md b/README.md index 1c7fb63f..6412d875 100644 --- a/README.md +++ b/README.md @@ -69,9 +69,11 @@ dependencies { #### Multiplatform -Colormath supports the following targets: `jvm`, `mingwX64`, `linuxX64`, `macosX64`, `ios`, -`watchos`, `tvos`, and `js` (for both NodeJS and Browsers). You'll need to use Gradle 6 or newer. -Artifacts for `macosArm64` and `linuxArm64` are also published, but not tested with CI. +Colormath publishes artifacts for all +[Tier 1 and Tier 2](https://kotlinlang.org/docs/native-target-support.html) +targets, as well as `mingwX64` and `wasm`. + +`wasm` and the `arm64` targets are not tested on CI. #### Snapshots diff --git a/colormath/build.gradle.kts b/colormath/build.gradle.kts index 0aa531f8..8d3f2060 100644 --- a/colormath/build.gradle.kts +++ b/colormath/build.gradle.kts @@ -13,6 +13,9 @@ kotlin { jvm() js { nodejs() } + @OptIn(ExperimentalWasmDsl::class) + wasmJs { nodejs() } + linuxX64() linuxArm64() mingwX64() @@ -32,7 +35,6 @@ kotlin { val commonTest by getting { dependencies { implementation(kotlin("test")) - implementation(libs.kotest) } } } diff --git a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/internal/MatrixTest.kt b/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/internal/MatrixTest.kt index ee937eba..d48aa20d 100644 --- a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/internal/MatrixTest.kt +++ b/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/internal/MatrixTest.kt @@ -1,8 +1,8 @@ package com.github.ajalt.colormath.internal -import io.kotest.matchers.shouldBe import kotlin.js.JsName import kotlin.test.Test +import kotlin.test.assertEquals class MatrixTest { @Test @@ -56,3 +56,8 @@ class MatrixTest { l.dot(10f, 20f, 30f).values shouldBe floatArrayOf(140f, 320f, 500f) } } + +// TODO(kotest): go back to kotest once is supports wasm +private infix fun Any?.shouldBe(other: Any?) { + assertEquals(other, this) +} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 35054c40..51c236a6 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,10 +1,10 @@ [versions] -kotlin = "1.9.20" -jbCompose = "1.5.10" +kotlin = "1.9.21" +jbCompose = "1.5.11" [libraries] # used in tests -kotest = "io.kotest:kotest-assertions-core:5.7.2" +kotest = "io.kotest:kotest-assertions-core:5.8.0" compose-ui-graphics = { module = "org.jetbrains.compose.ui:ui-graphics", version.ref = "jbCompose" } androidx-annotation = "androidx.annotation:annotation:1.7.0" junit = "junit:junit:4.13.2" diff --git a/settings.gradle.kts b/settings.gradle.kts index 75d793fe..b754b284 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,4 +1,5 @@ include("colormath") +include("test") include("extensions:colormath-ext-android-color") include("extensions:colormath-ext-android-colorint") include("extensions:colormath-ext-jetpack-compose") diff --git a/test/build.gradle.kts b/test/build.gradle.kts new file mode 100644 index 00000000..f34d94ed --- /dev/null +++ b/test/build.gradle.kts @@ -0,0 +1,46 @@ +import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl + +plugins { + kotlin("multiplatform") + alias(libs.plugins.publish) +} + +repositories { + mavenCentral() +} + +kotlin { + jvm() + js { nodejs() } + + linuxX64() + linuxArm64() + mingwX64() + macosX64() + macosArm64() + iosX64() + iosArm64() + iosSimulatorArm64() + tvosX64() + tvosArm64() + tvosSimulatorArm64() + watchosX64() + watchosArm64() + watchosSimulatorArm64() + + sourceSets { + val commonTest by getting { + dependencies { + api(project(":colormath")) + implementation(libs.kotest) + implementation(kotlin("test")) + } + } + } +} + +tasks.withType().configureEach { + manifest { + attributes("Automatic-Module-Name" to "com.github.ajalt.colormath") + } +} diff --git a/test/gradle.properties b/test/gradle.properties new file mode 100644 index 00000000..d7a11582 --- /dev/null +++ b/test/gradle.properties @@ -0,0 +1,2 @@ +POM_ARTIFACT_ID=colormath +POM_NAME=Colormath diff --git a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/CssParseTest.kt b/test/src/commonTest/kotlin/com/github/ajalt/colormath/CssParseTest.kt similarity index 100% rename from colormath/src/commonTest/kotlin/com/github/ajalt/colormath/CssParseTest.kt rename to test/src/commonTest/kotlin/com/github/ajalt/colormath/CssParseTest.kt diff --git a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/CssRenderTest.kt b/test/src/commonTest/kotlin/com/github/ajalt/colormath/CssRenderTest.kt similarity index 100% rename from colormath/src/commonTest/kotlin/com/github/ajalt/colormath/CssRenderTest.kt rename to test/src/commonTest/kotlin/com/github/ajalt/colormath/CssRenderTest.kt diff --git a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/HueColorTest.kt b/test/src/commonTest/kotlin/com/github/ajalt/colormath/HueColorTest.kt similarity index 100% rename from colormath/src/commonTest/kotlin/com/github/ajalt/colormath/HueColorTest.kt rename to test/src/commonTest/kotlin/com/github/ajalt/colormath/HueColorTest.kt diff --git a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/TestUtils.kt b/test/src/commonTest/kotlin/com/github/ajalt/colormath/TestUtils.kt similarity index 100% rename from colormath/src/commonTest/kotlin/com/github/ajalt/colormath/TestUtils.kt rename to test/src/commonTest/kotlin/com/github/ajalt/colormath/TestUtils.kt diff --git a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/calculate/ContrastTest.kt b/test/src/commonTest/kotlin/com/github/ajalt/colormath/calculate/ContrastTest.kt similarity index 100% rename from colormath/src/commonTest/kotlin/com/github/ajalt/colormath/calculate/ContrastTest.kt rename to test/src/commonTest/kotlin/com/github/ajalt/colormath/calculate/ContrastTest.kt diff --git a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/calculate/DifferenceTest.kt b/test/src/commonTest/kotlin/com/github/ajalt/colormath/calculate/DifferenceTest.kt similarity index 100% rename from colormath/src/commonTest/kotlin/com/github/ajalt/colormath/calculate/DifferenceTest.kt rename to test/src/commonTest/kotlin/com/github/ajalt/colormath/calculate/DifferenceTest.kt diff --git a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/calculate/GamutTest.kt b/test/src/commonTest/kotlin/com/github/ajalt/colormath/calculate/GamutTest.kt similarity index 100% rename from colormath/src/commonTest/kotlin/com/github/ajalt/colormath/calculate/GamutTest.kt rename to test/src/commonTest/kotlin/com/github/ajalt/colormath/calculate/GamutTest.kt diff --git a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/Ansi16Test.kt b/test/src/commonTest/kotlin/com/github/ajalt/colormath/model/Ansi16Test.kt similarity index 100% rename from colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/Ansi16Test.kt rename to test/src/commonTest/kotlin/com/github/ajalt/colormath/model/Ansi16Test.kt diff --git a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/Ansi256Test.kt b/test/src/commonTest/kotlin/com/github/ajalt/colormath/model/Ansi256Test.kt similarity index 100% rename from colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/Ansi256Test.kt rename to test/src/commonTest/kotlin/com/github/ajalt/colormath/model/Ansi256Test.kt diff --git a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/CMYKTest.kt b/test/src/commonTest/kotlin/com/github/ajalt/colormath/model/CMYKTest.kt similarity index 100% rename from colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/CMYKTest.kt rename to test/src/commonTest/kotlin/com/github/ajalt/colormath/model/CMYKTest.kt diff --git a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/HPLuvTest.kt b/test/src/commonTest/kotlin/com/github/ajalt/colormath/model/HPLuvTest.kt similarity index 100% rename from colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/HPLuvTest.kt rename to test/src/commonTest/kotlin/com/github/ajalt/colormath/model/HPLuvTest.kt diff --git a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/HSLTest.kt b/test/src/commonTest/kotlin/com/github/ajalt/colormath/model/HSLTest.kt similarity index 100% rename from colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/HSLTest.kt rename to test/src/commonTest/kotlin/com/github/ajalt/colormath/model/HSLTest.kt diff --git a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/HSLuvTest.kt b/test/src/commonTest/kotlin/com/github/ajalt/colormath/model/HSLuvTest.kt similarity index 100% rename from colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/HSLuvTest.kt rename to test/src/commonTest/kotlin/com/github/ajalt/colormath/model/HSLuvTest.kt diff --git a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/HSVTest.kt b/test/src/commonTest/kotlin/com/github/ajalt/colormath/model/HSVTest.kt similarity index 100% rename from colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/HSVTest.kt rename to test/src/commonTest/kotlin/com/github/ajalt/colormath/model/HSVTest.kt diff --git a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/HWBTest.kt b/test/src/commonTest/kotlin/com/github/ajalt/colormath/model/HWBTest.kt similarity index 100% rename from colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/HWBTest.kt rename to test/src/commonTest/kotlin/com/github/ajalt/colormath/model/HWBTest.kt diff --git a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/ICtCpTest.kt b/test/src/commonTest/kotlin/com/github/ajalt/colormath/model/ICtCpTest.kt similarity index 100% rename from colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/ICtCpTest.kt rename to test/src/commonTest/kotlin/com/github/ajalt/colormath/model/ICtCpTest.kt diff --git a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/JzAzBzTest.kt b/test/src/commonTest/kotlin/com/github/ajalt/colormath/model/JzAzBzTest.kt similarity index 100% rename from colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/JzAzBzTest.kt rename to test/src/commonTest/kotlin/com/github/ajalt/colormath/model/JzAzBzTest.kt diff --git a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/JzCzHzTest.kt b/test/src/commonTest/kotlin/com/github/ajalt/colormath/model/JzCzHzTest.kt similarity index 100% rename from colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/JzCzHzTest.kt rename to test/src/commonTest/kotlin/com/github/ajalt/colormath/model/JzCzHzTest.kt diff --git a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/LABTest.kt b/test/src/commonTest/kotlin/com/github/ajalt/colormath/model/LABTest.kt similarity index 100% rename from colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/LABTest.kt rename to test/src/commonTest/kotlin/com/github/ajalt/colormath/model/LABTest.kt diff --git a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/LCHabTest.kt b/test/src/commonTest/kotlin/com/github/ajalt/colormath/model/LCHabTest.kt similarity index 100% rename from colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/LCHabTest.kt rename to test/src/commonTest/kotlin/com/github/ajalt/colormath/model/LCHabTest.kt diff --git a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/LCHuvTest.kt b/test/src/commonTest/kotlin/com/github/ajalt/colormath/model/LCHuvTest.kt similarity index 100% rename from colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/LCHuvTest.kt rename to test/src/commonTest/kotlin/com/github/ajalt/colormath/model/LCHuvTest.kt diff --git a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/LUVTest.kt b/test/src/commonTest/kotlin/com/github/ajalt/colormath/model/LUVTest.kt similarity index 100% rename from colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/LUVTest.kt rename to test/src/commonTest/kotlin/com/github/ajalt/colormath/model/LUVTest.kt diff --git a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/OklabTest.kt b/test/src/commonTest/kotlin/com/github/ajalt/colormath/model/OklabTest.kt similarity index 100% rename from colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/OklabTest.kt rename to test/src/commonTest/kotlin/com/github/ajalt/colormath/model/OklabTest.kt diff --git a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/OklchTest.kt b/test/src/commonTest/kotlin/com/github/ajalt/colormath/model/OklchTest.kt similarity index 100% rename from colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/OklchTest.kt rename to test/src/commonTest/kotlin/com/github/ajalt/colormath/model/OklchTest.kt diff --git a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/RGBColorSpacesConversionTest.kt b/test/src/commonTest/kotlin/com/github/ajalt/colormath/model/RGBColorSpacesConversionTest.kt similarity index 100% rename from colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/RGBColorSpacesConversionTest.kt rename to test/src/commonTest/kotlin/com/github/ajalt/colormath/model/RGBColorSpacesConversionTest.kt diff --git a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/RGBColorSpacesTransferFunctionsTest.kt b/test/src/commonTest/kotlin/com/github/ajalt/colormath/model/RGBColorSpacesTransferFunctionsTest.kt similarity index 100% rename from colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/RGBColorSpacesTransferFunctionsTest.kt rename to test/src/commonTest/kotlin/com/github/ajalt/colormath/model/RGBColorSpacesTransferFunctionsTest.kt diff --git a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/RGBIntTest.kt b/test/src/commonTest/kotlin/com/github/ajalt/colormath/model/RGBIntTest.kt similarity index 100% rename from colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/RGBIntTest.kt rename to test/src/commonTest/kotlin/com/github/ajalt/colormath/model/RGBIntTest.kt diff --git a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/RGBTest.kt b/test/src/commonTest/kotlin/com/github/ajalt/colormath/model/RGBTest.kt similarity index 100% rename from colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/RGBTest.kt rename to test/src/commonTest/kotlin/com/github/ajalt/colormath/model/RGBTest.kt diff --git a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/XYZTest.kt b/test/src/commonTest/kotlin/com/github/ajalt/colormath/model/XYZTest.kt similarity index 86% rename from colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/XYZTest.kt rename to test/src/commonTest/kotlin/com/github/ajalt/colormath/model/XYZTest.kt index 590b9fa9..96ec9475 100644 --- a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/model/XYZTest.kt +++ b/test/src/commonTest/kotlin/com/github/ajalt/colormath/model/XYZTest.kt @@ -1,7 +1,5 @@ package com.github.ajalt.colormath.model -import com.github.ajalt.colormath.internal.CAT02_LMS_TO_XYZ -import com.github.ajalt.colormath.internal.CAT02_XYZ_TO_LMS import com.github.ajalt.colormath.model.LABColorSpaces.LAB50 import com.github.ajalt.colormath.model.LUVColorSpaces.LUV50 import com.github.ajalt.colormath.model.XYZColorSpaces.XYZ50 @@ -51,10 +49,13 @@ class XYZTest { XYZ(0.40, 0.50, 0.60) to Oklab(0.78539542, -0.06758384, -0.01449969), XYZ(1.00, 1.00, 1.00) to Oklab(1.00324405, 0.02673522, 0.0147436), XYZ(0.18, 0.18, 0.18).adaptTo(XYZ50) to Oklab(0.56645328, 0.01509528, 0.00832456), - XYZ(0.18, 0.18, 0.18).adaptTo(XYZ50, CAT02_XYZ_TO_LMS.rowMajor) to Oklab(0.56645328, 0.01509528, 0.00832456), - XYZ(0.18, 0.18, 0.18).adaptTo(XYZ50, CAT02_XYZ_TO_LMS.rowMajor, CAT02_LMS_TO_XYZ.rowMajor) to Oklab(0.56645328, - 0.01509528, - 0.00832456), + // TODO(kotest): reenable this when kotest supports wasm + // XYZ(0.18, 0.18, 0.18).adaptTo(XYZ50, CAT02_XYZ_TO_LMS) to Oklab( +// 0.56645328, 0.01509528, 0.00832456 +// ), +// XYZ(0.18, 0.18, 0.18).adaptTo(XYZ50, CAT02_XYZ_TO_LMS, CAT02_LMS_TO_XYZ.rowMajor) to Oklab( +// 0.56645328, 0.01509528, 0.00832456 +// ), ) @Test diff --git a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/transform/EasingFunctionsTest.kt b/test/src/commonTest/kotlin/com/github/ajalt/colormath/transform/EasingFunctionsTest.kt similarity index 100% rename from colormath/src/commonTest/kotlin/com/github/ajalt/colormath/transform/EasingFunctionsTest.kt rename to test/src/commonTest/kotlin/com/github/ajalt/colormath/transform/EasingFunctionsTest.kt diff --git a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/transform/HueAdjustmentsTest.kt b/test/src/commonTest/kotlin/com/github/ajalt/colormath/transform/HueAdjustmentsTest.kt similarity index 100% rename from colormath/src/commonTest/kotlin/com/github/ajalt/colormath/transform/HueAdjustmentsTest.kt rename to test/src/commonTest/kotlin/com/github/ajalt/colormath/transform/HueAdjustmentsTest.kt diff --git a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/transform/InterpolateTest.kt b/test/src/commonTest/kotlin/com/github/ajalt/colormath/transform/InterpolateTest.kt similarity index 100% rename from colormath/src/commonTest/kotlin/com/github/ajalt/colormath/transform/InterpolateTest.kt rename to test/src/commonTest/kotlin/com/github/ajalt/colormath/transform/InterpolateTest.kt diff --git a/colormath/src/commonTest/kotlin/com/github/ajalt/colormath/transform/TransformTest.kt b/test/src/commonTest/kotlin/com/github/ajalt/colormath/transform/TransformTest.kt similarity index 100% rename from colormath/src/commonTest/kotlin/com/github/ajalt/colormath/transform/TransformTest.kt rename to test/src/commonTest/kotlin/com/github/ajalt/colormath/transform/TransformTest.kt