Remove Spek add Kotest

This commit is contained in:
Edwin Jakobs
2023-11-18 22:36:35 +01:00
parent 2d3ae83729
commit 5012f8fb14
34 changed files with 255 additions and 309 deletions

View File

@@ -1,21 +1,25 @@
import org.amshove.kluent.`should be equal to`
package spaces
import io.kotest.core.spec.style.DescribeSpec
import org.openrndr.color.ColorRGBa
import org.openrndr.color.Linearity
import org.openrndr.extra.color.palettes.rangeTo
import org.spekframework.spek2.Spek
import org.spekframework.spek2.style.specification.describe
object TestMix : Spek({
import kotlin.test.assertEquals
import kotlin.test.assertSame
class TestMix : DescribeSpec({
describe("two srgb colors") {
val a = ColorRGBa.BLUE
val b = ColorRGBa.RED
a.linearity `should be equal to` Linearity.SRGB
assertEquals(Linearity.SRGB, a.linearity)
it("should mix properly") {
a.mix(b, 0.0) `should be equal to` a
a.mix(b, 1.0) `should be equal to` b
assertSame(a, a.mix(b, 0.0))
assertSame(b, a.mix(b, 1.0))
}
}
@@ -24,8 +28,8 @@ object TestMix : Spek({
val b = ColorRGBa.RED.toLinear()
it("should mix properly") {
a.mix(b, 0.0) `should be equal to` a
a.mix(b, 1.0) `should be equal to` b
assertSame(a, a.mix(b, 0.0))
assertSame(b, a.mix(b, 1.0))
}
}
@@ -34,9 +38,9 @@ object TestMix : Spek({
val b = ColorRGBa.RED
val blend = a..b blend 2
blend.size `should be equal to` 2
blend[0] `should be equal to` a
blend[1] `should be equal to` b
assertEquals(2, blend.size)
assertEquals(a, blend[0])
assertEquals(b, blend[1])
}
})

View File

@@ -2,7 +2,6 @@ package spaces
import org.openrndr.color.ColorRGBa
import org.openrndr.extra.color.spaces.toOKHSLa
import org.openrndr.extra.color.spaces.toOKHSVa
import kotlin.test.Test
import kotlin.test.assertTrue