From ef03e287a80067f72faa86ce28e7c2418144ecb2 Mon Sep 17 00:00:00 2001 From: tkadziolka Date: Sun, 28 Apr 2024 15:04:04 +0200 Subject: [PATCH] Created test case for potentiall error --- .../internal/locator/KeywordLocatorTest.kt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/commonTest/kotlin/dev/snipme/highlights/internal/locator/KeywordLocatorTest.kt b/src/commonTest/kotlin/dev/snipme/highlights/internal/locator/KeywordLocatorTest.kt index c2d1fa1..afb0042 100644 --- a/src/commonTest/kotlin/dev/snipme/highlights/internal/locator/KeywordLocatorTest.kt +++ b/src/commonTest/kotlin/dev/snipme/highlights/internal/locator/KeywordLocatorTest.kt @@ -97,6 +97,18 @@ internal class KeywordLocatorTest { assertEquals(0, result.size) } + @Test + fun `Not returns location of keyword inside phrase from start`() { + val testCode = """ + val intent = 0 + """.trimIndent() + val keywords = listOf("int") + + val result = KeywordLocator.locate(testCode, keywords) + + assertEquals(0, result.size) + } + @Test fun `Not returns keywords from single comment`() { val testCode = """