From 29871a925e62ae1247a06a0011031c7e2e127f94 Mon Sep 17 00:00:00 2001 From: ByrmGkcn Date: Wed, 6 Dec 2023 14:45:03 +0100 Subject: [PATCH] add basic Tests --- build.gradle.kts | 5 ++--- src/test/kotlin/ParserTest.kt | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 src/test/kotlin/ParserTest.kt diff --git a/build.gradle.kts b/build.gradle.kts index 47eb8b9..49fdc59 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -35,9 +35,8 @@ dependencies { implementation("io.ktor:ktor-server-netty:1.6.3") implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.2") implementation("io.ktor:ktor-html-builder:1.6.3") - - - + implementation("junit:junit:4.13.1") + testImplementation("junit:junit:4.13.1") } diff --git a/src/test/kotlin/ParserTest.kt b/src/test/kotlin/ParserTest.kt new file mode 100644 index 0000000..b210713 --- /dev/null +++ b/src/test/kotlin/ParserTest.kt @@ -0,0 +1,15 @@ +package main + +import junit.framework.TestCase.assertEquals +import org.junit.Test + +class ParserTest { + + @Test + fun testDelStrings() { + val input = "This is a \"sample\" string." + val output = delStrings(input) + assertEquals("This is a string.", output) + } + +}