mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
[terminal] fix test to not leak project via VirtualFile user data
GitOrigin-RevId: 6e28774968c52af4d517b8052925f97bf5f068db
This commit is contained in:
committed by
intellij-monorepo-bot
parent
c9495bd524
commit
f94d3a0e18
@@ -5,6 +5,7 @@ import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.openapi.editor.ex.EditorEx
|
||||
import com.intellij.openapi.fileEditor.FileDocumentManager
|
||||
import com.intellij.openapi.util.Disposer
|
||||
import com.intellij.openapi.util.removeUserData
|
||||
import com.intellij.testFramework.LightPlatformCodeInsightTestCase
|
||||
import org.jetbrains.plugins.terminal.block.prompt.TerminalPromptModel
|
||||
import org.jetbrains.plugins.terminal.block.util.TerminalDataContextUtils.IS_PROMPT_EDITOR_KEY
|
||||
@@ -94,6 +95,9 @@ internal class TerminalDeletePreviousWordTest : LightPlatformCodeInsightTestCase
|
||||
val virtualFile = FileDocumentManager.getInstance().getFile(editor.document)!!
|
||||
// Used in TerminalPromptFileViewProvider
|
||||
virtualFile.putUserData(TerminalPromptModel.KEY, promptModel)
|
||||
Disposer.register(testRootDisposable) {
|
||||
virtualFile.removeUserData(TerminalPromptModel.KEY)
|
||||
}
|
||||
virtualFile.putUserData(ShellType.KEY, ShellType.ZSH) // The shell type doesn't matter for this test
|
||||
return editor
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user