Skip to content

Commit

Permalink
Remove basePath parameter from compileContentForTest
Browse files Browse the repository at this point in the history
  • Loading branch information
3flex committed May 5, 2024
1 parent adc6d0c commit e2a3ff3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ class AnalyzerSpec(val env: KotlinCoreEnvironment) {
return createProcessingSettings(config = config) { project { basePath = root } }
.use { settings ->
Analyzer(settings, listOf(CustomRuleSetProvider()), emptyList())
.run(listOf(compileContentForTest("", root, Path(path))))
.run(listOf(compileContentForTest("", Path(path))))
.isNotEmpty()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class IsActiveOrDefaultSpec {
class ShouldAnalyzeFileSpec {

private val basePath = Path("/cases").absolute()
private val file = compileContentForTest("", basePath = basePath, path = Path("/cases/Default.kt"))
private val file = compileContentForTest("", path = Path("/cases/Default.kt"))

@Test
fun `analyzes file with an empty config`() {
Expand Down
4 changes: 2 additions & 2 deletions detekt-test-utils/api/detekt-test-utils.api
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
public final class io/github/detekt/test/utils/CompileExtensionsKt {
public static final fun compileContentForTest (Ljava/lang/String;Ljava/lang/String;)Lorg/jetbrains/kotlin/psi/KtFile;
public static final fun compileContentForTest (Ljava/lang/String;Ljava/nio/file/Path;Ljava/nio/file/Path;)Lorg/jetbrains/kotlin/psi/KtFile;
public static synthetic fun compileContentForTest$default (Ljava/lang/String;Ljava/nio/file/Path;Ljava/nio/file/Path;ILjava/lang/Object;)Lorg/jetbrains/kotlin/psi/KtFile;
public static final fun compileContentForTest (Ljava/lang/String;Ljava/nio/file/Path;)Lorg/jetbrains/kotlin/psi/KtFile;
public static synthetic fun compileContentForTest$default (Ljava/lang/String;Ljava/nio/file/Path;ILjava/lang/Object;)Lorg/jetbrains/kotlin/psi/KtFile;
public static final fun compileForTest (Ljava/nio/file/Path;)Lorg/jetbrains/kotlin/psi/KtFile;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ fun compileContentForTest(
*/
fun compileContentForTest(
@Language("kotlin") content: String,
basePath: Path = Path("/").absolute(),
path: Path = basePath.resolve("Test.kt"),
path: Path = Path("/").absolute().resolve("Test.kt"),
): KtFile {
return KtTestCompiler.createKtFile(content, path)
}
Expand Down

0 comments on commit e2a3ff3

Please sign in to comment.