package org.jetbrains.plugins.ideavim.ex;

import org.jetbrains.plugins.ideavim.VimTestCase;

/**
 * @author vlan
 */
public class VimScriptParserTest extends VimTestCase {
  public void testEchoStringLiteral() {
    configureByText("\n");
    typeText(commandToKeys("echo \"Hello, World!\""));
    assertExOutput("Hello, World!\n");
  }

  public void testLetStringLiteralEcho() {
    configureByText("\n");
    typeText(commandToKeys("let s = \"foo\""));
    typeText(commandToKeys("echo s"));
    assertExOutput("foo\n");
  }
}

@@ -36,16 +36,87 @@
 im.ex;%0A%0A
+import com.maddyhome.idea.vim.ex.vimscript.VimScriptGlobalEnvironment;%0A
 import o
@@ -517,24 +517,36 @@
 %5C%22foo%5C%22%22));%0A
+    try %7B%0A  
     typeText
@@ -568,24 +568,26 @@
 %22echo s%22));%0A
+  
     assertEx
@@ -599,18 +599,115 @@
 t(%22foo%5Cn%22);%0A
+    %7D%0A    finally %7B%0A      VimScriptGlobalEnvironment.getInstance().getVariables().clear();%0A    %7D%0A
   %7D%0A%7D%0A

Clean global variables