aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2024-03-07 06:14:00 +0100
committerLibravatar Alexander Foremny <aforemny@posteo.de>2024-03-07 06:14:00 +0100
commit7a121b63e2bc1e942dd68a7b4976e83fde7d286e (patch)
treedcf2d63326c75975122172538bbf390b889625cf /test
parent88e897fa21d0de229700862b11761b8e33752dba (diff)
chore: fix parsing special characters
Diffstat (limited to 'test')
-rw-r--r--test/Main.hs7
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 $#|]