From 88e897fa21d0de229700862b11761b8e33752dba Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Thu, 7 Mar 2024 06:01:47 +0100 Subject: chore: allow impure interpolation --- test/Main.hs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/Main.hs') diff --git a/test/Main.hs b/test/Main.hs index 9bde55e..0d00db3 100644 --- a/test/Main.hs +++ b/test/Main.hs @@ -40,6 +40,10 @@ main = hspec do (`shouldBe` "foobar") =<< let x = LB.pack "foobar" in [sh|echo -n '#{x}'|] it "interpolates expressions" do (`shouldBe` "1") =<< let x = 1 :: Int in [sh|echo -n '#{show x}'|] + 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}'|] describe "quoting" do it "preserves arguments" do (`shouldBe` "foo\\ bar") -- cgit v1.2.3