[Shell-escape] 'ascii-escape ' prefix toggle

This commit is contained in:
Nikolay Yakimov
2015-12-30 21:11:39 +03:00
parent d49d4cf2ea
commit 849496c047
2 changed files with 12 additions and 4 deletions

View File

@@ -10,9 +10,9 @@ spec =
describe "parseCmdLine" $ do
it "splits arguments" $ do
parseCmdLine "test command line" `shouldBe` ["test", "command", "line"]
parseCmdLine "\\test command line" `shouldBe` ["test", "command", "line"]
parseCmdLine "ascii-escape test command line" `shouldBe` ["test", "command", "line"]
it "honors quoted segments if turned on" $
parseCmdLine "\\test command line \STXwith quoted segment\ETX"
parseCmdLine "ascii-escape test command line \STXwith quoted segment\ETX"
`shouldBe` ["test", "command", "line", "with quoted segment"]
it "doesn't honor quoted segments if turned off" $
parseCmdLine "test command line \STXwith quoted segment\ETX"
@@ -20,5 +20,10 @@ spec =
it "squashes multiple spaces" $ do
parseCmdLine "test command"
`shouldBe` ["test", "command"]
parseCmdLine "\\test command"
parseCmdLine "ascii-escape test command"
`shouldBe` ["test", "command"]
it "ingores leading spaces" $ do
parseCmdLine " test command"
`shouldBe` ["test", "command"]
parseCmdLine " ascii-escape test command"
`shouldBe` ["test", "command"]