From 7a121b63e2bc1e942dd68a7b4976e83fde7d286e Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Thu, 7 Mar 2024 06:14:00 +0100 Subject: chore: fix parsing special characters --- test/Main.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'test/Main.hs') 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 $#|] -- cgit v1.2.3