ghc-mod/test/ShellParseSpec.hs
Nikolay Yakimov fff9087ff7 [Shell-Parse] Use \STX and \ETX for quoting
Also drops escaping
2015-12-27 02:45:20 +03:00

19 lines
526 B
Haskell

module ShellParseSpec where
import GHCMod.Options.ShellParse
import Test.Hspec
spec :: Spec
spec =
describe "parseCmdLine" $ do
it "splits arguments" $
parseCmdLine "test command line" `shouldBe` ["test", "command", "line"]
it "honors quoted segments" $
parseCmdLine "test command line \STXwith quoted segment\ETX"
`shouldBe` ["test", "command", "line", "with quoted segment"]
it "squashes multiple spaces" $
parseCmdLine "test command"
`shouldBe` ["test", "command"]