packages feed

chiasma-test 0.12.2.0 → 0.12.3.0

raw patch · 3 files changed

+10/−12 lines, 3 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Chiasma.Test.Data.TmuxTestConfig: instance GHC.Generics.Generic Chiasma.Test.Data.TmuxTestConfig.TmuxTestConfig
- Chiasma.Test.Data.TmuxTestConfig: instance GHC.Show.Show Chiasma.Test.Data.TmuxTestConfig.TmuxTestConfig
+ Chiasma.Test.Data.TmuxTestConfig: instance GHC.Internal.Generics.Generic Chiasma.Test.Data.TmuxTestConfig.TmuxTestConfig
+ Chiasma.Test.Data.TmuxTestConfig: instance GHC.Internal.Show.Show Chiasma.Test.Data.TmuxTestConfig.TmuxTestConfig
- Chiasma.Test.Tmux: createTmuxConf :: forall (r :: EffectRow). Member Test r => Path Abs File -> [Text] -> Sem r (Path Abs File)
+ Chiasma.Test.Tmux: createTmuxConf :: forall (r :: EffectRow). Member Test r => Path Abs File -> Path Abs File -> [Text] -> Sem r (Path Abs File)
- Chiasma.Test.Tmux: testTmuxProcessConfig :: forall (r :: EffectRow). Members '[Pty, Test, Embed IO] r => Path Abs File -> TmuxTestConfig -> Path Abs File -> Sem r (ProcessConfig () () ())
+ Chiasma.Test.Tmux: testTmuxProcessConfig :: forall (r :: EffectRow). Members '[Pty, Test, Embed IO] r => Path Abs File -> Path Abs File -> TmuxTestConfig -> Path Abs File -> Sem r (ProcessConfig () () ())

Files

chiasma-test.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack  name:           chiasma-test-version:        0.12.2.0+version:        0.12.3.0 synopsis:       Testing tools for chiasma description:    See https://hackage.haskell.org/package/chiasma-test/docs/Chiasma-Test.html category:       Terminal
integration/Chiasma/Test/Util.hs view
@@ -2,17 +2,12 @@  import Hedgehog (property, test, withTests) import Polysemy.Test (UnitTest)-import qualified System.Environment as Environment import Test.Tasty (TestName, TestTree) import Test.Tasty.Hedgehog (testProperty) -checkEnv :: UnitTest -> UnitTest-checkEnv t =-  maybe unit (const t) =<< liftIO (Environment.lookupEnv "DISPLAY")- integrationTest ::   TestName ->   UnitTest ->   TestTree integrationTest desc =-  testProperty desc . withTests 1 . property . test . checkEnv+  testProperty desc . withTests 1 . property . test
lib/Chiasma/Test/Tmux.hs view
@@ -56,14 +56,15 @@ createTmuxConf ::   Member Test r =>   Path Abs File ->+  Path Abs File ->   [Text] ->   Sem r (Path Abs File)-createTmuxConf wait content = do+createTmuxConf bash wait content = do   bashrc <- Test.tempFile bashrcContent [relfile|bashrc|]   Test.tempFile (defaultContent bashrc ++ content ++ initCommands) [relfile|tmux.conf|]   where     defaultContent rc =-      [[exon|set -g default-command '/usr/bin/env bash --noprofile --rcfile #{pathText rc}'|]]+      [[exon|set -g default-command '#{pathText bash} --noprofile --rcfile #{pathText rc}'|]]     initCommands =       [         [exon|run-shell -b 'touch #{pathText wait}'|]@@ -72,11 +73,12 @@ testTmuxProcessConfig ::   Members [Pty, Test, Embed IO] r =>   Path Abs File ->+  Path Abs File ->   TmuxTestConfig ->   Path Abs File ->   Sem r (ProcessConfig () () ())-testTmuxProcessConfig wait (TmuxTestConfig {..}) socket = do-  confFile <- createTmuxConf wait conf+testTmuxProcessConfig bash wait (TmuxTestConfig {..}) socket = do+  confFile <- createTmuxConf bash wait conf   Pty.resize width height   handle <- Pty.handle   let@@ -154,8 +156,9 @@   let socket = tempDir </> [relfile|tmux_socket|]   let wait = tempDir </> [relfile|wait|]   exe <- fromEither =<< resolveExecutable [relfile|tmux|] Nothing+  bash <- fromEither =<< resolveExecutable [relfile|bash|] Nothing   interpretPty $ resumeHoistError @_ @(Scoped_ _) show $ withPty do-    pc <- testTmuxProcessConfig wait tConf socket+    pc <- testTmuxProcessConfig bash wait tConf socket     interpretSystemProcessNativeOpaqueSingle pc $ runReader (TmuxNative exe (Just socket)) do       void $ Race.timeout (throw "tmux didn't start") (Seconds 3) (waitForFile wait)       interpretCodecPanes $ interpretCodecTmuxCommand $ interpretTmuxNative $ restop @TmuxError do