override fun getRecordsForTest()

in src/main/kotlin/com/pestphp/pest/runner/PestFailedLineManager.kt [28:48]


    override fun getRecordsForTest(testElement: PsiElement): List<TestStateStorage.Record> {
        val testLocationUrl = getTestLocationUrl(testElement) ?: return emptyList()
        val testStateRecord = TestStateStorage.getInstance(testElement.project).getState(testLocationUrl) ?: return emptyList()

        val project = testElement.getProject()
        val records = mutableListOf(testStateRecord)
        if (testStateRecord.failedLine == -1 && (testElement.parent as? MethodReference)?.isDatasetCall() == true) {
            val allRecordLocationUrls = TestStateStorage.getInstance(project).keys
            val dataSetRecords: List<TestStateStorage.Record> = allRecordLocationUrls
                .asSequence()
                .filterNotNull()
                .filter { recordLocationUrl -> isLocationUrlWithNamedDatasetValue(recordLocationUrl, testLocationUrl) }
                .map { recordLocationUrl -> TestStateStorage.getInstance(project).getState(recordLocationUrl) }
                .filterNotNull()
                .filter { record -> record.failedLine != -1 }
                .toList()

            records.addAll(dataSetRecords)
        }
        return records
    }