From 9a0b67f938319a58a501e87a1509fb8ec6b8b392 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 4 Jan 2024 20:30:09 +0600 Subject: [PATCH] fix of tests --- colors/common/build.gradle | 33 ------------------- .../src/commonTest/kotlin/HexColorTests.kt | 6 +++- 2 files changed, 5 insertions(+), 34 deletions(-) diff --git a/colors/common/build.gradle b/colors/common/build.gradle index ba6963d2308..d425197852e 100644 --- a/colors/common/build.gradle +++ b/colors/common/build.gradle @@ -5,36 +5,3 @@ plugins { } apply from: "$mppJvmJsAndroidLinuxMingwLinuxArm64ProjectPresetPath" - -kotlin { - sourceSets { - jvmMain { - dependencies { - api project(":micro_utils.coroutines") - } - } - androidMain { - dependencies { - api project(":micro_utils.coroutines") - api libs.android.fragment - } - dependsOn jvmMain - } - - linuxX64Main { - dependencies { - api libs.okio - } - } - mingwX64Main { - dependencies { - api libs.okio - } - } - linuxArm64Main { - dependencies { - api libs.okio - } - } - } -} diff --git a/colors/common/src/commonTest/kotlin/HexColorTests.kt b/colors/common/src/commonTest/kotlin/HexColorTests.kt index ea2a79a4a21..8d710c82a53 100644 --- a/colors/common/src/commonTest/kotlin/HexColorTests.kt +++ b/colors/common/src/commonTest/kotlin/HexColorTests.kt @@ -19,6 +19,7 @@ class HexColorTests { val g: Int, val b: Int, val a: Int, + vararg val additionalRGBAVariants: String ) val testColors: List get() = listOf( @@ -34,6 +35,7 @@ class HexColorTests { g = 0x00, b = 0x00, a = 0xff, + "rgba(255,0,0,1)", ), TestColor( color = HEXAColor(uint = 0x00ff00ffu), @@ -47,6 +49,7 @@ class HexColorTests { g = 0xff, b = 0x00, a = 0xff, + "rgba(0,255,0,1)" ), TestColor( color = HEXAColor(0x0000ffffu), @@ -60,6 +63,7 @@ class HexColorTests { g = 0x00, b = 0xff, a = 0xff, + "rgba(0,0,255,1)" ), TestColor( color = HEXAColor(0xff000088u), @@ -149,7 +153,7 @@ class HexColorTests { assertEquals(it.shortHex, it.color.shortHex) assertEquals(it.shortHexa, it.color.shortHexa) assertEquals(it.rgb, it.color.rgb) - assertEquals(it.rgba, it.color.rgba) + assertTrue(it.rgba == it.color.rgba || it.color.rgba in it.additionalRGBAVariants) assertEquals(it.r, it.color.r) assertEquals(it.g, it.color.g) assertEquals(it.b, it.color.b)