module
Analyzer::Kotlin::KotlinEngine
Defined in:
analyzer/engines/kotlin_engine.crConstant Summary
-
TEST_PATH_RE =
Regex.union("/src/test/", "/jvmTest/", "/commonTest/", "/jsTest/", "/nativeTest/", "/test/", "/testData/") -
Standard Kotlin/JUnit/Gradle test-source conventions:
/src/test/— Maven/Gradle JVM test root/jvmTest//commonTest/— Gradle Kotlin Multiplatform test source sets/jsTest//nativeTest//test/anywhere under a Gradlekotlin { }source dir (KMP uses<target>/test/rather than thesrc/test/Maven layout)/testData/— Kotlin compiler-plugin fixture dir used byktor-compiler-plugin/testData/...- Filenames ending in
Test.kt/Tests.kt— JUnit/Kotest
ktor's own repo registers ~370 phantom endpoints from
ktor-client/...-tests/modules and*/jvm/test/...directories that exercise the routing DSL under inline test servers.Takes the scan-base-relative path (
Analyzer#base_relative_path), never the absolute one./test/is generic enough that matching the absolute path made the answer depend on where the checkout lived: the same tree under~/work/test/reported 0 endpoints instead of 93.One precompiled
Regex.union(PCRE2 JIT, auto-escapes each literal) replaces the seven OR-edString#includes?passes — equivalent to any of those substrings. BasenameTest.kt/Tests.ktchecks stay separate: putting them in the union would also match mid-path segments like.../FooTest.kt/bar.kt.