diff --git a/dsl-core/src/commonTest/kotlin/it/unibo/tuprolog/dsl/PlatformSpecificValues.kt b/dsl-core/src/commonTest/kotlin/it/unibo/tuprolog/dsl/PlatformSpecificValues.kt index e8d5bd7c9..ca30a7f46 100644 --- a/dsl-core/src/commonTest/kotlin/it/unibo/tuprolog/dsl/PlatformSpecificValues.kt +++ b/dsl-core/src/commonTest/kotlin/it/unibo/tuprolog/dsl/PlatformSpecificValues.kt @@ -5,4 +5,5 @@ import it.unibo.tuprolog.core.Numeric expect object PlatformSpecificValues { val THREE_POINT_ONE_FLOAT: Numeric val ONE_POINT_ZERO: Numeric + val MINUS_THREE: Numeric } \ No newline at end of file diff --git a/dsl-core/src/commonTest/kotlin/it/unibo/tuprolog/dsl/TestProlog.kt b/dsl-core/src/commonTest/kotlin/it/unibo/tuprolog/dsl/TestProlog.kt index 4a8967967..da175abfb 100644 --- a/dsl-core/src/commonTest/kotlin/it/unibo/tuprolog/dsl/TestProlog.kt +++ b/dsl-core/src/commonTest/kotlin/it/unibo/tuprolog/dsl/TestProlog.kt @@ -3,6 +3,7 @@ package it.unibo.tuprolog.dsl import it.unibo.tuprolog.core.* import it.unibo.tuprolog.core.List import it.unibo.tuprolog.core.Set +import it.unibo.tuprolog.dsl.PlatformSpecificValues.MINUS_THREE import it.unibo.tuprolog.dsl.PlatformSpecificValues.ONE_POINT_ZERO import it.unibo.tuprolog.dsl.PlatformSpecificValues.THREE_POINT_ONE_FLOAT import kotlin.test.Test @@ -28,6 +29,9 @@ class TestProlog { assertDSLCreationIsCorrect(Integer.of(1)) { numOf(1) } + assertDSLCreationIsCorrect(Integer.of(-3)) { + numOf(-3) + } assertDSLCreationIsCorrect(Integer.of(1)) { numOf(1L) } @@ -74,6 +78,9 @@ class TestProlog { assertDSLCreationIsCorrect(Integer.of(1)) { 1.toTerm() } + assertDSLCreationIsCorrect(MINUS_THREE) { + (-3).toTerm() + } assertDSLCreationIsCorrect(ONE_POINT_ZERO) { 1.0.toTerm() } diff --git a/dsl-core/src/jsTest/kotlin/it/unibo/tuprolog/dsl/PlatformSpecificValues.kt b/dsl-core/src/jsTest/kotlin/it/unibo/tuprolog/dsl/PlatformSpecificValues.kt index d8ead7565..79cfbc932 100644 --- a/dsl-core/src/jsTest/kotlin/it/unibo/tuprolog/dsl/PlatformSpecificValues.kt +++ b/dsl-core/src/jsTest/kotlin/it/unibo/tuprolog/dsl/PlatformSpecificValues.kt @@ -8,4 +8,6 @@ actual object PlatformSpecificValues { actual val THREE_POINT_ONE_FLOAT: Numeric = Real.of("3.1") actual val ONE_POINT_ZERO: Numeric = Integer.of(1) + + actual val MINUS_THREE: Numeric = Real.of("-3.0") } \ No newline at end of file diff --git a/dsl-core/src/jvmTest/kotlin/it/unibo/tuprolog/dsl/PlatformSpecificValues.kt b/dsl-core/src/jvmTest/kotlin/it/unibo/tuprolog/dsl/PlatformSpecificValues.kt index 4078f12ce..da7837ce1 100644 --- a/dsl-core/src/jvmTest/kotlin/it/unibo/tuprolog/dsl/PlatformSpecificValues.kt +++ b/dsl-core/src/jvmTest/kotlin/it/unibo/tuprolog/dsl/PlatformSpecificValues.kt @@ -1,5 +1,6 @@ package it.unibo.tuprolog.dsl +import it.unibo.tuprolog.core.Integer import it.unibo.tuprolog.core.Numeric import it.unibo.tuprolog.core.Real @@ -7,4 +8,6 @@ actual object PlatformSpecificValues { actual val THREE_POINT_ONE_FLOAT: Numeric = Real.of("3.0999999046325684") actual val ONE_POINT_ZERO: Numeric = Real.of("1.0") + + actual val MINUS_THREE: Numeric = Integer.of(-3) } \ No newline at end of file