diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ad483b9e..247eba17 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -12,7 +12,6 @@ dokka = "1.7.10" nebulaRelease = "18.0.7" gradleNexusPublish = "2.0.0" boofcv = "1.2.2" -kluent = "1.73" junitJupiter = "5.12.2" slf4j = "2.0.17" libfreenect = "0.5.7-1.5.9" @@ -84,7 +83,6 @@ jsoup = { group = "org.jsoup", name = "jsoup", version.ref = "jsoup" } jupiter-api = { group = "org.junit.jupiter", name = "junit-jupiter-api", version.ref = "junitJupiter" } jupiter-engine = { group = "org.junit.jupiter", name = "junit-jupiter-engine", version.ref = "junitJupiter" } -kluent = { group = "org.amshove.kluent", name = "kluent", version.ref = "kluent" } slf4j-simple = { group = "org.slf4j", name = "slf4j-simple", version.ref = "slf4j" } [plugins] diff --git a/orx-color/src/commonTest/kotlin/mixing/TestSpectral.kt b/orx-color/src/commonTest/kotlin/mixing/TestSpectral.kt index 906a0217..b9dcb62e 100644 --- a/orx-color/src/commonTest/kotlin/mixing/TestSpectral.kt +++ b/orx-color/src/commonTest/kotlin/mixing/TestSpectral.kt @@ -14,7 +14,7 @@ class TestSpectral { for (c in colors) { val r = linearToReflectance(c) - assertEquals(r.size, 38) + assertEquals(38, r.size) val xyz = reflectanceToXYZ(r) val cp = xyz.toRGBa().matchLinearity(c) assertTrue(cp.toVector4().distanceTo(c.toVector4()) < 5E-3) diff --git a/orx-expression-evaluator-typed/build.gradle.kts b/orx-expression-evaluator-typed/build.gradle.kts index 67cc0971..ef3c105c 100644 --- a/orx-expression-evaluator-typed/build.gradle.kts +++ b/orx-expression-evaluator-typed/build.gradle.kts @@ -20,10 +20,5 @@ kotlin { implementation(project(":orx-jvm:orx-gui")) } } - val jvmTest by getting { - dependencies { - implementation(libs.kluent) - } - } } } diff --git a/orx-expression-evaluator-typed/src/jvmTest/kotlin/typed/TestListLiteralExpression.kt b/orx-expression-evaluator-typed/src/jvmTest/kotlin/typed/TestListLiteralExpression.kt index fb4a50f8..9321b321 100644 --- a/orx-expression-evaluator-typed/src/jvmTest/kotlin/typed/TestListLiteralExpression.kt +++ b/orx-expression-evaluator-typed/src/jvmTest/kotlin/typed/TestListLiteralExpression.kt @@ -2,7 +2,6 @@ package typed import org.junit.jupiter.api.Assertions.assertEquals import org.openrndr.extra.expressions.typed.evaluateTypedExpression -import org.openrndr.math.Vector2 import kotlin.test.Test import kotlin.test.assertTrue diff --git a/orx-expression-evaluator-typed/src/jvmTest/kotlin/typed/TestTypedCompiledExpression.kt b/orx-expression-evaluator-typed/src/jvmTest/kotlin/typed/TestTypedCompiledExpression.kt index ab0f7a61..5184c3f3 100644 --- a/orx-expression-evaluator-typed/src/jvmTest/kotlin/typed/TestTypedCompiledExpression.kt +++ b/orx-expression-evaluator-typed/src/jvmTest/kotlin/typed/TestTypedCompiledExpression.kt @@ -3,6 +3,7 @@ package typed import org.openrndr.extra.expressions.typed.compileFunction1OrNull import org.openrndr.extra.noise.uniform import org.openrndr.math.Vector2 +import kotlin.math.cos import kotlin.test.Test import kotlin.test.assertEquals @@ -111,7 +112,6 @@ class TestTypedCompiledExpression { val c3 = compileFunction1OrNull, Double>("cos(2.0)", "x", constants = env)!! val r3 = c3(emptyMap()) - - + assertEquals(cos(2.0), r3, 1E-6) } } \ No newline at end of file diff --git a/orx-expression-evaluator/build.gradle.kts b/orx-expression-evaluator/build.gradle.kts index cea03475..e8cdc020 100644 --- a/orx-expression-evaluator/build.gradle.kts +++ b/orx-expression-evaluator/build.gradle.kts @@ -47,11 +47,6 @@ kotlin { implementation(project(":orx-jvm:orx-gui")) } } - val jvmTest by getting { - dependencies { - implementation(libs.kluent) - } - } } } diff --git a/orx-expression-evaluator/src/jvmTest/kotlin/TestCompiledExpression.kt b/orx-expression-evaluator/src/jvmTest/kotlin/TestCompiledExpression.kt index 61fbc482..3abcc478 100644 --- a/orx-expression-evaluator/src/jvmTest/kotlin/TestCompiledExpression.kt +++ b/orx-expression-evaluator/src/jvmTest/kotlin/TestCompiledExpression.kt @@ -1,33 +1,32 @@ -import org.amshove.kluent.invoking -import org.amshove.kluent.`should throw` -import org.amshove.kluent.shouldBeEqualTo import org.junit.jupiter.api.Test +import org.junit.jupiter.api.assertThrows import org.openrndr.extra.expressions.ExpressionException import org.openrndr.extra.expressions.compileExpression +import kotlin.test.assertEquals class TestCompiledExpression { @Test fun `a simple compiled expression`() { val expression = "someValue" val function = compileExpression(expression, constants = mutableMapOf("someValue" to 5.0)) - function().shouldBeEqualTo(5.0) + assertEquals(5.0, function()) } @Test fun `a compiled expression with updated context`() { val expression = "someValue" - val context = mutableMapOf("someValue" to 5.0) + val context = mutableMapOf("someValue" to 5.0) val function = compileExpression(expression, constants = context) - function().shouldBeEqualTo(5.0) + assertEquals(5.0, function()) context["someValue"] = 6.0 - function().shouldBeEqualTo(6.0) + assertEquals(6.0, function()) } @Test fun `an erroneous compiled expression`() { val expression = "1bork" - invoking { + assertThrows { compileExpression(expression, constants = mutableMapOf("someValue" to 5.0)) - } `should throw` ExpressionException::class + } } } \ No newline at end of file diff --git a/orx-expression-evaluator/src/jvmTest/kotlin/TestCompiledFunctions.kt b/orx-expression-evaluator/src/jvmTest/kotlin/TestCompiledFunctions.kt index 45195cb3..709db5da 100644 --- a/orx-expression-evaluator/src/jvmTest/kotlin/TestCompiledFunctions.kt +++ b/orx-expression-evaluator/src/jvmTest/kotlin/TestCompiledFunctions.kt @@ -1,29 +1,29 @@ -import org.amshove.kluent.invoking -import org.amshove.kluent.`should throw` -import org.amshove.kluent.shouldBeEqualTo import org.junit.jupiter.api.Test -import org.openrndr.extra.expressions.* +import org.openrndr.extra.expressions.compileFunction1 +import org.openrndr.extra.expressions.compileFunction2 +import org.openrndr.extra.expressions.compileFunction3 +import kotlin.test.assertEquals class TestCompiledFunctions { @Test fun `a simple compiled function1`() { val expression = "t" val function = compileFunction1(expression, "t") - function(-5.0).shouldBeEqualTo(-5.0) - function(5.0).shouldBeEqualTo(5.0) + assertEquals(-5.0, function(-5.0)) + assertEquals(5.0, function(5.0)) } @Test fun `a simple compiled function2`() { val expression = "x + y" val function = compileFunction2(expression, "x", "y") - function(1.0, 2.0).shouldBeEqualTo(3.0) + assertEquals(3.0, function(1.0, 2.0)) } @Test fun `a simple compiled function3`() { val expression = "x + y + z" val function = compileFunction3(expression, "x", "y", "z") - function(1.0, 2.0, 3.0).shouldBeEqualTo(6.0) + assertEquals(6.0, function(1.0, 2.0, 3.0)) } } \ No newline at end of file diff --git a/orx-expression-evaluator/src/jvmTest/kotlin/TestExpressionDelegates.kt b/orx-expression-evaluator/src/jvmTest/kotlin/TestExpressionDelegates.kt index 8f811bd7..c69b8405 100644 --- a/orx-expression-evaluator/src/jvmTest/kotlin/TestExpressionDelegates.kt +++ b/orx-expression-evaluator/src/jvmTest/kotlin/TestExpressionDelegates.kt @@ -1,6 +1,6 @@ -import org.amshove.kluent.shouldBeEqualTo import org.openrndr.extra.expressions.watchingExpression1 import kotlin.test.Test +import kotlin.test.assertEquals class TestExpressionDelegates { @@ -10,7 +10,6 @@ class TestExpressionDelegates { var expression = "x * x" val function1 by watchingExpression1(::expression, "x") } - state.function1(5.0).shouldBeEqualTo(25.0) + assertEquals(25.0, state.function1(5.0)) } - } \ No newline at end of file diff --git a/orx-expression-evaluator/src/jvmTest/kotlin/TestExpressionErrors.kt b/orx-expression-evaluator/src/jvmTest/kotlin/TestExpressionErrors.kt index c4b385e6..d4876af0 100644 --- a/orx-expression-evaluator/src/jvmTest/kotlin/TestExpressionErrors.kt +++ b/orx-expression-evaluator/src/jvmTest/kotlin/TestExpressionErrors.kt @@ -1,45 +1,51 @@ -import org.amshove.kluent.`should throw` -import org.amshove.kluent.`with message` -import org.amshove.kluent.invoking +import org.junit.jupiter.api.assertThrows import org.openrndr.extra.expressions.ExpressionException import org.openrndr.extra.expressions.evaluateExpression import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.test.assertFailsWith class TestExpressionErrors { @Test fun `an expression with non-sensible writing`() { val expression = ")(" - invoking { + assertThrows { evaluateExpression(expression) - } `should throw` ExpressionException::class - + } } @Test fun `an expression trying to reassign a number`() { val expression = "3 = 5" - invoking { + assertThrows { evaluateExpression(expression) - } `should throw` ExpressionException::class + } } @Test fun `an expression that uses non-existing functions`() { val expression = "notExisting(5)" - invoking { + val exception = assertFailsWith { evaluateExpression(expression) - } `should throw` ExpressionException::class `with message` "error in evaluation of 'notExisting(5)': unresolved function: 'notExisting(x0)'" - + } + assertEquals( + "error in evaluation of 'notExisting(5)': unresolved function: 'notExisting(x0)'", + exception.message + ) } @Test fun `an expression that uses non-existing variables`() { val expression = "notExisting + 4" - invoking { + val exception = assertFailsWith { evaluateExpression(expression) - } `should throw` ExpressionException::class `with message` "error in evaluation of 'notExisting+4': unresolved value: 'notExisting'. available values: {}" + } + assertEquals( + "error in evaluation of 'notExisting+4': unresolved value: 'notExisting'. available values: {}", + exception.message + ) } } diff --git a/orx-expression-evaluator/src/jvmTest/kotlin/TestExpressions.kt b/orx-expression-evaluator/src/jvmTest/kotlin/TestExpressions.kt index c322a857..1a4b9549 100644 --- a/orx-expression-evaluator/src/jvmTest/kotlin/TestExpressions.kt +++ b/orx-expression-evaluator/src/jvmTest/kotlin/TestExpressions.kt @@ -1,22 +1,23 @@ -import org.amshove.kluent.shouldBeEqualTo -import org.amshove.kluent.shouldBeNear import org.openrndr.extra.expressions.FunctionExtensions import org.openrndr.extra.expressions.evaluateExpression import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.test.assertNotNull + class TestExpressions { @Test fun `a value reference`() { val expression = "someValue" - val result = evaluateExpression(expression, constants= mapOf("someValue" to 5.0)) - result?.shouldBeEqualTo(5.0) + val result = evaluateExpression(expression, constants = mapOf("someValue" to 5.0)) + assertEquals(5.0, result) } @Test fun `a backticked value reference`() { val expression = "`some-value`" - val result = evaluateExpression(expression, constants= mapOf("some-value" to 5.0)) - result?.shouldBeEqualTo(5.0) + val result = evaluateExpression(expression, constants = mapOf("some-value" to 5.0)) + assertEquals(5.0, result) } @@ -24,111 +25,174 @@ class TestExpressions { fun `a function call`() { val expression = "sqrt(4.0)" val result = evaluateExpression(expression) - result?.shouldBeNear(2.0, 10E-6) + assertNotNull(result) + assertEquals(2.0, result, 10E-6) } @Test fun `a function call with the name in backticks`() { val expression = "`sqrt`(4.0)" val result = evaluateExpression(expression) - result?.shouldBeNear(2.0, 10E-6) + assertNotNull(result) + assertEquals(2.0, result, 10E-6) } @Test fun `two function calls`() { val expression = "sqrt(4.0) * sqrt(4.0)" val result = evaluateExpression(expression) - result?.shouldBeNear(4.0, 10E-6) + assertNotNull(result) + assertEquals(4.0, result, 10E-6) } @Test fun `two argument max function call`() { val expression = "max(0.0, 4.0)" val result = evaluateExpression(expression) - result?.shouldBeNear(4.0, 10E-6) + assertNotNull(result) + assertEquals(4.0, result, 10E-6) } @Test fun `two argument min function call`() { val expression = "min(8.0, 4.0)" val result = evaluateExpression(expression) - result?.shouldBeNear(4.0, 10E-6) + assertNotNull(result) + assertEquals(4.0, result, 10E-6) } @Test fun `three argument function call`() { val expression = "mix(8.0, 4.0, 0.5)" val result = evaluateExpression(expression) - result?.shouldBeNear(6.0, 10E-6) + assertNotNull(result) + assertEquals(6.0, result, 10E-6) } @Test fun `five argument function call`() { val expression = "map(0.0, 1.0, 0.0, 8.0, 0.5)" val result = evaluateExpression(expression) - result?.shouldBeNear(4.0, 10E-6) + assertNotNull(result) + assertEquals(4.0, result, 10E-6) } @Test fun `two argument function call, where argument order matters`() { val expression = "pow(2.0, 3.0)" val result = evaluateExpression(expression) - result?.shouldBeNear(8.0, 10E-6) + assertNotNull(result) + assertEquals(8.0, result, 10E-6) } @Test fun `nested function call`() { val expression = "sqrt(min(8.0, 4.0))" val result = evaluateExpression(expression) - result?.shouldBeNear(2.0, 10E-6) + assertNotNull(result) + assertEquals(2.0, result, 10E-6) } @Test fun `extension function0 call`() { val expression = "extension()" - val result = evaluateExpression(expression, functions = FunctionExtensions(functions0 = mapOf("extension" to { 2.0 }))) - result?.shouldBeNear(2.0, 10E-6) + val result = evaluateExpression( + expression, + functions = FunctionExtensions( + functions0 = mapOf("extension" to { 2.0 }) + ) + ) + assertNotNull(result) + assertEquals(2.0, result, 10E-6) } @Test - fun `extension function1 call`(){ + fun `extension function1 call`() { val expression = "extension(1.0)" - val result = evaluateExpression(expression, functions = FunctionExtensions(functions1 = mapOf("extension" to { x -> x * 2.0 }))) - result?.shouldBeNear(2.0, 10E-6) + val result = evaluateExpression( + expression, + functions = FunctionExtensions( + functions1 = mapOf("extension" to { x -> + x * 2.0 + }) + ) + ) + assertNotNull(result) + assertEquals(2.0, result, 10E-6) } @Test - fun `extension function1 call with dashed name in backticks`(){ + fun `extension function1 call with dashed name in backticks`() { val expression = "`extension-function`(1.0)" - val result = evaluateExpression(expression, functions = FunctionExtensions(functions1 = mapOf("extension-function" to { x -> x * 2.0 }))) - result?.shouldBeNear(2.0, 10E-6) + val result = evaluateExpression( + expression, + functions = FunctionExtensions( + functions1 = mapOf("extension-function" to { x -> + x * 2.0 + }) + ) + ) + assertNotNull(result) + assertEquals(2.0, result, 10E-6) } @Test fun `extension function2 call`() { val expression = "extension(1.0, 1.0)" - val result = evaluateExpression(expression, functions = FunctionExtensions(functions2 = mapOf("extension" to { x, y -> x + y }))) - result?.shouldBeNear(2.0, 10E-6) + val result = evaluateExpression( + expression, + functions = FunctionExtensions( + functions2 = mapOf("extension" to { x, y -> + x + y + }) + ) + ) + assertNotNull(result) + assertEquals(2.0, result, 10E-6) } @Test fun `extension function3 call`() { val expression = "extension(1.0, 1.0, 1.0)" - val result = evaluateExpression(expression, functions = FunctionExtensions(functions3 = mapOf("extension" to { x, y, z -> x + y + z}))) - result?.shouldBeNear(3.0, 10E-6) + val result = evaluateExpression( + expression, + functions = FunctionExtensions( + functions3 = mapOf("extension" to { x, y, z -> + x + y + z + }) + ) + ) + assertNotNull(result) + assertEquals(3.0, result, 10E-6) } @Test fun `extension function4 call`() { val expression = "extension(1.0, 1.0, 1.0, 1.0)" - val result = evaluateExpression(expression, functions = FunctionExtensions(functions4 = mapOf("extension" to { x, y, z, w -> x + y + z + w}))) - result?.shouldBeNear(4.0, 10E-6) + val result = evaluateExpression( + expression, + functions = FunctionExtensions( + functions4 = mapOf("extension" to { x, y, z, w -> + x + y + z + w + }) + ) + ) + assertNotNull(result) + assertEquals(4.0, result, 10E-6) } @Test fun `extension function5 call`() { val expression = "extension(1.0, 1.0, 1.0, 1.0, 1.0)" - val result = evaluateExpression(expression, functions = FunctionExtensions(functions5 = mapOf("extension" to { x, y, z, w, u -> x + y + z + w + u}))) - result?.shouldBeNear(5.0, 10E-6) + val result = evaluateExpression( + expression, + functions = FunctionExtensions( + functions5 = mapOf("extension" to { x, y, z, w, u -> + x + y + z + w + u + }) + ) + ) + assertNotNull(result) + assertEquals(5.0, result, 10E-6) } } \ No newline at end of file diff --git a/orx-expression-evaluator/src/jvmTest/kotlin/TestOperators.kt b/orx-expression-evaluator/src/jvmTest/kotlin/TestOperators.kt index a3191252..9f01a60d 100644 --- a/orx-expression-evaluator/src/jvmTest/kotlin/TestOperators.kt +++ b/orx-expression-evaluator/src/jvmTest/kotlin/TestOperators.kt @@ -1,53 +1,62 @@ -import org.amshove.kluent.shouldBeNear import org.openrndr.extra.expressions.evaluateExpression import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.test.assertNotNull class TestOperators { @Test fun `an addition operation`() { val result = evaluateExpression("1 + 2") - result?.shouldBeNear(3.0, 10E-6) + assertNotNull(result) + assertEquals(3.0, result, 10E-6) } @Test fun `a subtraction operation`() { val result = evaluateExpression("1 - 2") - result?.shouldBeNear(-1.0, 10E-6) + assertNotNull(result) + assertEquals(-1.0, result, 10E-6) } @Test fun `a modulus operation`() { val result = evaluateExpression("4 % 2") - result?.shouldBeNear(0.0, 10E-6) + assertNotNull(result) + assertEquals(0.0, result, 10E-6) } @Test fun `a multiplication operation`() { val result = evaluateExpression("4 * 2") - result?.shouldBeNear(8.0, 10E-6) + assertNotNull(result) + assertEquals(8.0, result, 10E-6) } @Test fun `a division operation`() { val result = evaluateExpression("4 / 2") - result?.shouldBeNear(2.0, 10E-6) + assertNotNull(result) + assertEquals(2.0, result, 10E-6) } @Test fun `a multiplication and addition operation`() { val result = evaluateExpression("4 * 2 + 1") - result?.shouldBeNear(9.0, 10E-6) + assertNotNull(result) + assertEquals(9.0, result, 10E-6) } @Test fun `an addition and multiplication`() { val result = evaluateExpression("4 + 2 * 3") - result?.shouldBeNear(10.0, 10E-6) + assertNotNull(result) + assertEquals(10.0, result, 10E-6) } @Test fun `unary minus`() { val result = evaluateExpression("-4.0") - result?.shouldBeNear(-4.0, 10E-6) + assertNotNull(result) + assertEquals(-4.0, result, 10E-6) } } diff --git a/orx-jvm/orx-keyframer/build.gradle.kts b/orx-jvm/orx-keyframer/build.gradle.kts index 2813e509..c9e81a39 100644 --- a/orx-jvm/orx-keyframer/build.gradle.kts +++ b/orx-jvm/orx-keyframer/build.gradle.kts @@ -19,5 +19,4 @@ dependencies { implementation(project(":orx-easing")) api(project(":orx-expression-evaluator")) demoImplementation(project(":orx-jvm:orx-panel")) - testImplementation(libs.kluent) } diff --git a/orx-jvm/orx-keyframer/src/test/kotlin/TestKeyframerChannel.kt b/orx-jvm/orx-keyframer/src/test/kotlin/TestKeyframerChannel.kt index 29680a48..fca59311 100644 --- a/orx-jvm/orx-keyframer/src/test/kotlin/TestKeyframerChannel.kt +++ b/orx-jvm/orx-keyframer/src/test/kotlin/TestKeyframerChannel.kt @@ -1,15 +1,14 @@ -import org.amshove.kluent.`should be` -import org.amshove.kluent.shouldBeNear -import org.openrndr.extra.keyframer.KeyframerChannel import org.openrndr.extra.easing.Easing - +import org.openrndr.extra.keyframer.KeyframerChannel import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.test.assertNull class TestKeyframerChannel { @Test fun `a keyframer channel without keys`() { val kfc = KeyframerChannel() - kfc.value(0.0) `should be` null + assertNull(kfc.value(0.0)) } @Test @@ -17,8 +16,11 @@ class TestKeyframerChannel { val kfc = KeyframerChannel() kfc.add(0.0, 1.0, Easing.Linear.function) - kfc.value(0.0)?.shouldBeNear(1.0, 10E-6) - kfc.value(-1.0) `should be` null + val value = kfc.value(0.0) + if (value != null) { + assertEquals(1.0, value, 10E-6) + } + assertNull(kfc.value(-1.0)) } @Test @@ -26,7 +28,10 @@ class TestKeyframerChannel { val kfc = KeyframerChannel() kfc.add(0.0, 1.0, Easing.Linear.function) kfc.add(1.0, 2.0, Easing.Linear.function) - kfc.value(0.0)?.shouldBeNear(1.0, 10E-6) - kfc.value(-1.0) `should be` null + val value = kfc.value(0.0) + if (value != null) { + assertEquals(1.0, value, 10E-6) + } + assertNull(kfc.value(-1.0)) } } \ No newline at end of file diff --git a/orx-jvm/orx-keyframer/src/test/kotlin/TestKeyframerErrors.kt b/orx-jvm/orx-keyframer/src/test/kotlin/TestKeyframerErrors.kt index d3618d56..634ec926 100644 --- a/orx-jvm/orx-keyframer/src/test/kotlin/TestKeyframerErrors.kt +++ b/orx-jvm/orx-keyframer/src/test/kotlin/TestKeyframerErrors.kt @@ -1,5 +1,4 @@ -import org.amshove.kluent.`should throw` -import org.amshove.kluent.invoking +import org.junit.jupiter.api.assertThrows import org.openrndr.extra.expressions.ExpressionException import kotlin.test.Test @@ -27,14 +26,18 @@ class TestKeyframerErrors { val animation = Animation() val json = """ """ - invoking { animation.loadFromJsonString(json) } `should throw` (IllegalStateException::class) + assertThrows { + animation.loadFromJsonString(json) + } } @Test fun `loading a non existing json`() { val animation = Animation() - invoking { animation.loadFromJson(testFile("this-does-not-exist")) } `should throw` (IllegalArgumentException::class) + assertThrows { + animation.loadFromJson(testFile("this-does-not-exist")) + } } @Test @@ -47,12 +50,12 @@ class TestKeyframerErrors { val animation = Animation() - invoking { + assertThrows { animation.loadFromJson( testFile("src/test/resources/error-reporting/time-01.json"), format = KeyframerFormat.SIMPLE ) - } `should throw` ExpressionException::class //`with message` "Error loading from '${testName("src/test/resources/error-reporting/time-01.json")}': error in keys[0].'time': parser error in expression: ')('; [line: 1, character: 0 , near: [@0,0:0=')',<21>,1:0] ]" + } //`with message` "Error loading from '${testName("src/test/resources/error-reporting/time-01.json")}': error in keys[0].'time': parser error in expression: ')('; [line: 1, character: 0 , near: [@0,0:0=')',<21>,1:0] ]" } @@ -64,34 +67,34 @@ class TestKeyframerErrors { @Test fun `loading a json with a faulty time expression (2) `() { val animation = Animation() - invoking { + assertThrows { animation.loadFromJson( testFile("src/test/resources/error-reporting/time-02.json"), format = KeyframerFormat.SIMPLE ) - } `should throw` ExpressionException::class //`with message` "Error loading from '${testName("src/test/resources/error-reporting/time-02.json")}': error in keys[0].'time': error in evaluation of 'doesNotExist': unresolved variable: 'doesNotExist'" + } //`with message` "Error loading from '${testName("src/test/resources/error-reporting/time-02.json")}': error in keys[0].'time': error in evaluation of 'doesNotExist': unresolved variable: 'doesNotExist'" } @Test fun `loading a json with a non-existing easing`() { val animation = Animation() - invoking { + assertThrows { animation.loadFromJson( testFile("src/test/resources/error-reporting/easing.json"), format = KeyframerFormat.SIMPLE ) - } `should throw` ExpressionException::class //`with message` "Error loading from '${testName("src/test/resources/error-reporting/easing.json")}': error in keys[0].'easing': unknown easing name 'garble'" + } //`with message` "Error loading from '${testName("src/test/resources/error-reporting/easing.json")}': error in keys[0].'easing': unknown easing name 'garble'" } @Test fun `loading a json with a faulty value (1)`() { val animation = Animation() - invoking { + assertThrows { animation.loadFromJson( testFile("src/test/resources/error-reporting/value-01.json"), format = KeyframerFormat.SIMPLE ) - } `should throw` ExpressionException::class //`with message` "Error loading from '${testName("src/test/resources/error-reporting/value-01.json")}': error in keys[0].'x': error in evaluation of 'garble': unresolved variable: 'garble'" + } //`with message` "Error loading from '${testName("src/test/resources/error-reporting/value-01.json")}': error in keys[0].'x': error in evaluation of 'garble': unresolved variable: 'garble'" } } diff --git a/orx-jvm/orx-kotlin-parser/build.gradle.kts b/orx-jvm/orx-kotlin-parser/build.gradle.kts index 28aebeb3..6011bd6c 100644 --- a/orx-jvm/orx-kotlin-parser/build.gradle.kts +++ b/orx-jvm/orx-kotlin-parser/build.gradle.kts @@ -19,7 +19,6 @@ tasks.withType { dependencies { antlr(libs.antlr.core) implementation(libs.antlr.runtime) - testImplementation(libs.kluent) } tasks.getByName("compileKotlin").dependsOn("generateGrammarSource") diff --git a/orx-jvm/orx-olive/build.gradle.kts b/orx-jvm/orx-olive/build.gradle.kts index 24b0a584..43c8326e 100644 --- a/orx-jvm/orx-olive/build.gradle.kts +++ b/orx-jvm/orx-olive/build.gradle.kts @@ -27,7 +27,6 @@ dependencies { implementation(libs.kotlin.scriptingJSR223) implementation(libs.kotlin.coroutines) demoImplementation(libs.kotlin.coroutines) - testImplementation(libs.kluent) testImplementation(libs.kotest.runner) testImplementation(libs.kotest.assertions) testRuntimeOnly(libs.kotlin.reflect) diff --git a/orx-parameters/src/jvmTest/kotlin/TestAnnotations.kt b/orx-parameters/src/jvmTest/kotlin/TestAnnotations.kt index 2c8bc7b6..977326be 100644 --- a/orx-parameters/src/jvmTest/kotlin/TestAnnotations.kt +++ b/orx-parameters/src/jvmTest/kotlin/TestAnnotations.kt @@ -1,6 +1,5 @@ import io.kotest.assertions.throwables.shouldThrowUnit import io.kotest.core.spec.style.DescribeSpec -import io.kotest.matchers.collections.shouldBeIn import io.kotest.matchers.doubles.plusOrMinus import io.kotest.matchers.equals.shouldBeEqual import io.kotest.matchers.nulls.shouldBeNull @@ -134,11 +133,11 @@ class TestAnnotations : DescribeSpec({ list[11].property?.name?.shouldBeEqual("o") list[11].label shouldBeEqual "an option parameter" - assertEquals(list[12].parameterType, ParameterType.Path) - assertEquals(list[12].property?.name, "p") - assertEquals(list[12].label, "a path parameter") - assertEquals(list[12].absolutePath, false) - assertEquals(list[12].pathContext, "null") + assertEquals(ParameterType.Path, list[12].parameterType) + assertEquals("p", list[12].property?.name) + assertEquals("a path parameter", list[12].label) + assertEquals(false, list[12].absolutePath) + assertEquals("null", list[12].pathContext) } } diff --git a/orx-property-watchers/build.gradle.kts b/orx-property-watchers/build.gradle.kts index 6b2940d7..4eca6be1 100644 --- a/orx-property-watchers/build.gradle.kts +++ b/orx-property-watchers/build.gradle.kts @@ -28,7 +28,6 @@ kotlin { @Suppress("UNUSED_VARIABLE") val jvmTest by getting { dependencies { - implementation(libs.kluent) runtimeOnly(libs.kotlin.reflect) } }