From 30bb92cc9350ce8adbdb6a277667e7518a143d06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wieland=20Sch=C3=B6bl?= Date: Sun, 11 Apr 2021 22:58:02 +0200 Subject: [PATCH] Add Kotlin Unit tests --- src/test/kotlin/org/hmcore/tests/KotlinTests.kt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/test/kotlin/org/hmcore/tests/KotlinTests.kt diff --git a/src/test/kotlin/org/hmcore/tests/KotlinTests.kt b/src/test/kotlin/org/hmcore/tests/KotlinTests.kt new file mode 100644 index 0000000..8e961ec --- /dev/null +++ b/src/test/kotlin/org/hmcore/tests/KotlinTests.kt @@ -0,0 +1,17 @@ +package org.hmcore.tests + +import org.hmcore.HMCore +import org.junit.jupiter.api.Test + +// The primary function of the Kotlin tests is to ensure Kotlin-specific features are preserved +// Meaning some tests might only make sure features work at compile time. + +@Test +fun `Module should support index access operator`() { + HMCore.modules["ores"]!!["other"] +} + +@Test +fun `Module should support 'in' keyword`() { + HMCore.modules["ores"]?.let { "copper" in it } +} \ No newline at end of file