1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2025-03-06 18:32:51 +01:00

Better place for cleaning global variables

This commit is contained in:
Andrey Vlasovskikh 2015-04-24 14:31:06 +03:00
parent 3a47583cf9
commit 7d033787eb
2 changed files with 4 additions and 8 deletions
test/org/jetbrains/plugins/ideavim

View File

@ -18,6 +18,7 @@ import com.maddyhome.idea.vim.KeyHandler;
import com.maddyhome.idea.vim.VimPlugin;
import com.maddyhome.idea.vim.command.CommandState;
import com.maddyhome.idea.vim.ex.ExOutputModel;
import com.maddyhome.idea.vim.ex.vimscript.VimScriptGlobalEnvironment;
import com.maddyhome.idea.vim.helper.EditorDataContext;
import com.maddyhome.idea.vim.helper.RunnableHelper;
import com.maddyhome.idea.vim.helper.StringHelper;
@ -69,6 +70,7 @@ public abstract class VimTestCase extends UsefulTestCase {
myFixture.tearDown();
myFixture = null;
ExEntryPanel.getInstance().deactivate(false);
VimScriptGlobalEnvironment.getInstance().getVariables().clear();
super.tearDown();
}

View File

@ -1,6 +1,5 @@
package org.jetbrains.plugins.ideavim.ex;
import com.maddyhome.idea.vim.ex.vimscript.VimScriptGlobalEnvironment;
import org.jetbrains.plugins.ideavim.VimTestCase;
/**
@ -16,12 +15,7 @@ public class VimScriptParserTest extends VimTestCase {
public void testLetStringLiteralEcho() {
configureByText("\n");
typeText(commandToKeys("let s = \"foo\""));
try {
typeText(commandToKeys("echo s"));
assertExOutput("foo\n");
}
finally {
VimScriptGlobalEnvironment.getInstance().getVariables().clear();
}
typeText(commandToKeys("echo s"));
assertExOutput("foo\n");
}
}