mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-04-24 00:21:28 +00:00
Don't assert order of todo items to fix platform update to 193
This commit is contained in:
@@ -6,10 +6,10 @@
|
||||
package org.jetbrains.kotlin.search
|
||||
|
||||
import com.intellij.psi.search.PsiTodoSearchHelper
|
||||
import com.intellij.psi.search.TodoItem
|
||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase
|
||||
import org.jetbrains.kotlin.idea.test.KotlinLightProjectDescriptor
|
||||
import org.jetbrains.kotlin.idea.test.PluginTestCaseBase
|
||||
import org.junit.Assert
|
||||
import java.io.File
|
||||
|
||||
class TodoSearchTest : KotlinLightCodeInsightFixtureTestCase() {
|
||||
@@ -23,13 +23,16 @@ class TodoSearchTest : KotlinLightCodeInsightFixtureTestCase() {
|
||||
val file = myFixture.configureByFile("todoCall.kt")
|
||||
val todoItems = PsiTodoSearchHelper.SERVICE.getInstance(myFixture.project).findTodoItems(file)
|
||||
assertEquals(3, todoItems.size)
|
||||
verifyTodoItemText(todoItems[0], "TODO(\"Fix me\")")
|
||||
verifyTodoItemText(todoItems[1], "TODO()")
|
||||
verifyTodoItemText(todoItems[2], "TODO(\"Fix me in lambda\")")
|
||||
}
|
||||
|
||||
private fun verifyTodoItemText(todoItem: TodoItem, s: String) {
|
||||
assertEquals(s, todoItem.textRange.substring(todoItem.file.text))
|
||||
val actualItems = todoItems.map { it.textRange.substring(it.file.text) }
|
||||
Assert.assertEquals(
|
||||
listOf(
|
||||
"TODO(\"Fix me\")",
|
||||
"TODO()",
|
||||
"TODO(\"Fix me in lambda\")"
|
||||
).sorted(),
|
||||
actualItems.sorted()
|
||||
)
|
||||
}
|
||||
|
||||
fun testTodoDef() {
|
||||
|
||||
Reference in New Issue
Block a user