Search in index under read action in tests
This commit is contained in:
@@ -240,9 +240,11 @@ abstract class KotlinDebuggerTestBase : KotlinDebuggerTestCase() {
|
|||||||
|
|
||||||
private fun createBreakpoint(fileName: String, lineMarker: String) {
|
private fun createBreakpoint(fileName: String, lineMarker: String) {
|
||||||
val project = getProject()!!
|
val project = getProject()!!
|
||||||
val sourceFiles = FilenameIndex.getAllFilesByExt(project, "kt").filter {
|
val sourceFiles = runReadAction {
|
||||||
it.getName().contains(fileName) &&
|
FilenameIndex.getAllFilesByExt(project, "kt").filter {
|
||||||
it.contentsToByteArray().toString("UTF-8").contains(lineMarker)
|
it.getName().contains(fileName) &&
|
||||||
|
it.contentsToByteArray().toString("UTF-8").contains(lineMarker)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(sourceFiles.size() == 1) { "One source file should be found: name = $fileName, sourceFiles = $sourceFiles" }
|
assert(sourceFiles.size() == 1) { "One source file should be found: name = $fileName, sourceFiles = $sourceFiles" }
|
||||||
|
|||||||
Reference in New Issue
Block a user