summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/TestUtil.kt10
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/utils/UtilsSpec.kt19
2 files changed, 29 insertions, 0 deletions
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/TestUtil.kt b/src/test/kotlin/test/pl/treksoft/kvision/TestUtil.kt
index fbda7a45..87c0e87f 100644
--- a/src/test/kotlin/test/pl/treksoft/kvision/TestUtil.kt
+++ b/src/test/kotlin/test/pl/treksoft/kvision/TestUtil.kt
@@ -18,6 +18,16 @@ interface TestSpec {
}
}
+interface SimpleSpec : TestSpec {
+
+ override fun beforeTest() {
+ }
+
+ override fun afterTest() {
+ }
+
+}
+
interface DomSpec : TestSpec {
override fun beforeTest() {
diff --git a/src/test/kotlin/test/pl/treksoft/kvision/utils/UtilsSpec.kt b/src/test/kotlin/test/pl/treksoft/kvision/utils/UtilsSpec.kt
new file mode 100644
index 00000000..5ea10c7a
--- /dev/null
+++ b/src/test/kotlin/test/pl/treksoft/kvision/utils/UtilsSpec.kt
@@ -0,0 +1,19 @@
+package test.pl.treksoft.kvision.utils
+
+import pl.treksoft.kvision.utils.Utils
+import test.pl.treksoft.kvision.SimpleSpec
+import kotlin.test.Test
+import kotlin.test.assertEquals
+
+class UtilsSpec : SimpleSpec {
+
+ @Test
+ fun intToHexString() {
+ run {
+ val res = Utils.intToHexString(0xabcdef)
+ assertEquals("abcdef", res, "Should convert int value to hex string")
+ val res2 = Utils.intToHexString(0x123456)
+ assertEquals("123456", res2, "Should convert int value to hex string")
+ }
+ }
+} \ No newline at end of file