aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2024-03-08 05:00:53 +0100
committerLibravatar Alexander Foremny <aforemny@posteo.de>2024-03-08 05:00:53 +0100
commitb0f442b78a6b2c7d8978ae958bcadcc23ff82199 (patch)
tree179b9a8a85134456a4385cb6d07265bf56587925 /test
parent64d495b4cfbbeb3fcc72b5b8771874793d8fc6a3 (diff)
chore: use `${{..}}` for impure interpolation
Diffstat (limited to 'test')
-rw-r--r--test/Main.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/Main.hs b/test/Main.hs
index 71723c3..e00ccf6 100644
--- a/test/Main.hs
+++ b/test/Main.hs
@@ -1,8 +1,10 @@
{-# LANGUAGE BlockArguments #-}
+{-# LANGUAGE PartialTypeSignatures #-}
{-# LANGUAGE QuasiQuotes #-}
module Main (main) where
+import Control.Monad.Reader
import Data.ByteString.Char8 qualified as B
import Data.ByteString.Lazy.Char8 qualified as LB
import Data.Text qualified as T
@@ -41,7 +43,9 @@ main = hspec do
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}'|]
+ (`shouldBe` "1") =<< let x = 1 :: Int in [sh|echo -n '#{{pure @IO x}}'|]
+ it "interpolates monadic expressions" do
+ (`shouldBe` "1") =<< runReaderT [sh|echo -n '#{{asks fst}}'|] (1 :: Int, 2 :: Int)
it "preserves argument order" do
(`shouldBe` "1 2") =<< let x = "1"; y = "2" in [sh|echo -n '#{x}' '#{y}'|]
describe "quoting" do