diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/Main.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/Main.hs b/test/Main.hs index 0d00db3..71723c3 100644 --- a/test/Main.hs +++ b/test/Main.hs @@ -43,7 +43,7 @@ main = hspec do it "interpolates monadic expressions" do (`shouldBe` "1") =<< let x = 1 :: Int in [sh|echo -n '#{pure @IO x}'|] it "preserves argument order" do - (`shouldBe` "1 2") =<< let x = "1"; y = "2"; in [sh|echo -n '#{x}' '#{y}'|] + (`shouldBe` "1 2") =<< let x = "1"; y = "2" in [sh|echo -n '#{x}' '#{y}'|] describe "quoting" do it "preserves arguments" do (`shouldBe` "foo\\ bar") @@ -57,3 +57,8 @@ main = hspec do it "preserves empty arguments" do (`shouldBe` "''") =<< let x = "" in [sh|printf %q #{x}|] (`shouldBe` "''") =<< let x = "" in [sh|printf %q '#{x}'|] + describe "parsing" do + it "parses shell quotes" do + (`shouldBe` "foobar") =<< [sh|echo -n 'foobar'|] + it "parses double cross" do + (`shouldBe` "0") =<< [sh|echo -n $#|] |