packages feed

chiasma-test 0.10.0.0 → 0.10.1.0

raw patch · 7 files changed

+64/−143 lines, 7 filesdep ~basedep ~prelatePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base, prelate

API changes (from Hackage documentation)

Files

+ changelog.md view
@@ -0,0 +1,1 @@+# 0.10.1.0
chiasma-test.cabal view
@@ -1,22 +1,25 @@ cabal-version: 2.2 --- This file has been generated from package.yaml by hpack version 0.34.7.+-- This file has been generated from package.yaml by hpack version 0.35.2. -- -- see: https://github.com/sol/hpack  name:           chiasma-test-version:        0.10.0.0-synopsis:       A tmux client for Polysemy+version:        0.10.1.0+synopsis:       Testing tools for chiasma description:    See https://hackage.haskell.org/package/chiasma-test/docs/Chiasma-Test.html category:       Terminal homepage:       https://github.com/tek/chiasma#readme bug-reports:    https://github.com/tek/chiasma/issues author:         Torsten Schmits maintainer:     hackage@tryp.io-copyright:      2022 Torsten Schmits+copyright:      2023 Torsten Schmits license:        BSD-2-Clause-Patent license-file:   LICENSE build-type:     Simple+extra-source-files:+    readme.md+    changelog.md  source-repository head   type: git@@ -31,71 +34,43 @@   hs-source-dirs:       lib   default-extensions:-      ImpredicativeTypes       AllowAmbiguousTypes       ApplicativeDo-      BangPatterns-      BinaryLiterals       BlockArguments-      ConstraintKinds       DataKinds       DefaultSignatures       DeriveAnyClass-      DeriveDataTypeable-      DeriveFoldable-      DeriveFunctor-      DeriveGeneric-      DeriveLift-      DeriveTraversable       DerivingStrategies       DerivingVia       DisambiguateRecordFields-      DoAndIfThenElse       DuplicateRecordFields-      EmptyCase-      EmptyDataDecls-      ExistentialQuantification-      FlexibleContexts-      FlexibleInstances       FunctionalDependencies       GADTs-      GeneralizedNewtypeDeriving-      InstanceSigs-      KindSignatures       LambdaCase       LiberalTypeSynonyms-      MultiParamTypeClasses       MultiWayIf-      NamedFieldPuns       OverloadedLabels       OverloadedLists       OverloadedStrings       PackageImports       PartialTypeSignatures-      PatternGuards       PatternSynonyms-      PolyKinds       QuantifiedConstraints       QuasiQuotes-      RankNTypes       RecordWildCards       RecursiveDo       RoleAnnotations-      ScopedTypeVariables-      StandaloneDeriving       TemplateHaskell-      TupleSections-      TypeApplications       TypeFamilies       TypeFamilyDependencies-      TypeOperators-      TypeSynonymInstances       UndecidableInstances       UnicodeSyntax       ViewPatterns-  ghc-options: -Wall -Wredundant-constraints -Wincomplete-uni-patterns -Wmissing-deriving-strategies -Widentities -Wunused-packages -fplugin=Polysemy.Plugin+      OverloadedRecordDot+      NoFieldSelectors+  ghc-options: -fplugin=Polysemy.Plugin -Wall -Widentities -Wincomplete-uni-patterns -Wmissing-deriving-strategies -Wredundant-constraints -Wunused-type-patterns -Wunused-packages   build-depends:-      base >=4.12 && <5+      base ==4.*     , bytestring     , chiasma     , chronos@@ -111,199 +86,144 @@     , polysemy-process     , polysemy-test >=0.6     , polysemy-time-    , prelate >=0.2+    , prelate >=0.6 && <0.8     , text     , typed-process >=0.2   mixins:       base hiding (Prelude)     , prelate (Prelate as Prelude)     , prelate hiding (Prelate)-  default-language: Haskell2010+  default-language: GHC2021 -test-suite chiasma-test-integration+test-suite chiasma-test-test   type: exitcode-stdio-1.0   main-is: Main.hs   other-modules:-      Chiasma.Test.CaptureTest-      Chiasma.Test.FindTest-      Chiasma.Test.RenderTest-      Chiasma.Test.TmuxTest+      Chiasma.Test.CodecTest+      Chiasma.Test.LensTest+      Chiasma.Test.OutputParseTest+      Chiasma.Test.PinTest+      Chiasma.Test.PureTest       Chiasma.Test.Util   hs-source-dirs:-      integration+      test   default-extensions:-      ImpredicativeTypes       AllowAmbiguousTypes       ApplicativeDo-      BangPatterns-      BinaryLiterals       BlockArguments-      ConstraintKinds       DataKinds       DefaultSignatures       DeriveAnyClass-      DeriveDataTypeable-      DeriveFoldable-      DeriveFunctor-      DeriveGeneric-      DeriveLift-      DeriveTraversable       DerivingStrategies       DerivingVia       DisambiguateRecordFields-      DoAndIfThenElse       DuplicateRecordFields-      EmptyCase-      EmptyDataDecls-      ExistentialQuantification-      FlexibleContexts-      FlexibleInstances       FunctionalDependencies       GADTs-      GeneralizedNewtypeDeriving-      InstanceSigs-      KindSignatures       LambdaCase       LiberalTypeSynonyms-      MultiParamTypeClasses       MultiWayIf-      NamedFieldPuns       OverloadedLabels       OverloadedLists       OverloadedStrings       PackageImports       PartialTypeSignatures-      PatternGuards       PatternSynonyms-      PolyKinds       QuantifiedConstraints       QuasiQuotes-      RankNTypes       RecordWildCards       RecursiveDo       RoleAnnotations-      ScopedTypeVariables-      StandaloneDeriving       TemplateHaskell-      TupleSections-      TypeApplications       TypeFamilies       TypeFamilyDependencies-      TypeOperators-      TypeSynonymInstances       UndecidableInstances       UnicodeSyntax       ViewPatterns-  ghc-options: -Wall -Wredundant-constraints -Wincomplete-uni-patterns -Wmissing-deriving-strategies -Widentities -Wunused-packages -fplugin=Polysemy.Plugin -threaded -rtsopts -with-rtsopts=-N+      OverloadedRecordDot+      NoFieldSelectors+  ghc-options: -fplugin=Polysemy.Plugin -threaded -rtsopts -with-rtsopts=-N -Wall -Widentities -Wincomplete-uni-patterns -Wmissing-deriving-strategies -Wredundant-constraints -Wunused-type-patterns -Wunused-packages   build-depends:-      base >=4.12 && <5+      base ==4.*     , chiasma     , chiasma-test     , hedgehog     , lens >=4-    , path-io     , polysemy-    , polysemy-chronos     , polysemy-plugin     , polysemy-test >=0.6-    , prelate >=0.2+    , prelate >=0.6 && <0.8     , tasty     , tasty-hedgehog   mixins:       base hiding (Prelude)     , prelate (Prelate as Prelude)     , prelate hiding (Prelate)-  default-language: Haskell2010+  default-language: GHC2021 -test-suite chiasma-test-unit+test-suite integration   type: exitcode-stdio-1.0   main-is: Main.hs   other-modules:-      Chiasma.Test.CodecTest-      Chiasma.Test.LensTest-      Chiasma.Test.OutputParseTest-      Chiasma.Test.PinTest-      Chiasma.Test.PureTest+      Chiasma.Test.CaptureTest+      Chiasma.Test.FindTest+      Chiasma.Test.RenderTest+      Chiasma.Test.TmuxTest       Chiasma.Test.Util   hs-source-dirs:-      test+      integration   default-extensions:-      ImpredicativeTypes       AllowAmbiguousTypes       ApplicativeDo-      BangPatterns-      BinaryLiterals       BlockArguments-      ConstraintKinds       DataKinds       DefaultSignatures       DeriveAnyClass-      DeriveDataTypeable-      DeriveFoldable-      DeriveFunctor-      DeriveGeneric-      DeriveLift-      DeriveTraversable       DerivingStrategies       DerivingVia       DisambiguateRecordFields-      DoAndIfThenElse       DuplicateRecordFields-      EmptyCase-      EmptyDataDecls-      ExistentialQuantification-      FlexibleContexts-      FlexibleInstances       FunctionalDependencies       GADTs-      GeneralizedNewtypeDeriving-      InstanceSigs-      KindSignatures       LambdaCase       LiberalTypeSynonyms-      MultiParamTypeClasses       MultiWayIf-      NamedFieldPuns       OverloadedLabels       OverloadedLists       OverloadedStrings       PackageImports       PartialTypeSignatures-      PatternGuards       PatternSynonyms-      PolyKinds       QuantifiedConstraints       QuasiQuotes-      RankNTypes       RecordWildCards       RecursiveDo       RoleAnnotations-      ScopedTypeVariables-      StandaloneDeriving       TemplateHaskell-      TupleSections-      TypeApplications       TypeFamilies       TypeFamilyDependencies-      TypeOperators-      TypeSynonymInstances       UndecidableInstances       UnicodeSyntax       ViewPatterns-  ghc-options: -Wall -Wredundant-constraints -Wincomplete-uni-patterns -Wmissing-deriving-strategies -Widentities -Wunused-packages -fplugin=Polysemy.Plugin -threaded -rtsopts -with-rtsopts=-N+      OverloadedRecordDot+      NoFieldSelectors+  ghc-options: -fplugin=Polysemy.Plugin -threaded -rtsopts -with-rtsopts=-N -Wall -Widentities -Wincomplete-uni-patterns -Wmissing-deriving-strategies -Wredundant-constraints -Wunused-type-patterns -Wunused-packages   build-depends:-      base >=4.12 && <5+      base ==4.*     , chiasma+    , chiasma-test     , hedgehog     , lens >=4+    , path-io     , polysemy+    , polysemy-chronos     , polysemy-plugin     , polysemy-test >=0.6-    , prelate >=0.2+    , prelate >=0.6 && <0.8     , tasty     , tasty-hedgehog   mixins:       base hiding (Prelude)     , prelate (Prelate as Prelude)     , prelate hiding (Prelate)-  default-language: Haskell2010+  default-language: GHC2021
integration/Chiasma/Test/FindTest.hs view
@@ -25,8 +25,8 @@   tmuxTest $ interpretCodecPanes do     (Pid pid, found) <- withTmuxApis_ @[TmuxCommand, Panes Pid] @CodecError do       win <- TmuxApi.send (NewWindow def)-      pane <- splitWindow (windowId win)-      p1 <- TmuxApi.send (Panes.Get (Pane.paneId pane))+      pane <- splitWindow win.windowId+      p1 <- TmuxApi.send (Panes.Get (pane.paneId))       p2 <- TmuxApi.send (Panes.Find 100)       pure (p1, p2)     assert (pid > 0)
integration/Chiasma/Test/RenderTest.hs view
@@ -17,8 +17,7 @@ import Chiasma.Data.TmuxId (PaneId (PaneId), SessionId (SessionId), WindowId (WindowId)) import Chiasma.Data.TmuxRequest (TmuxRequest) import Chiasma.Data.TmuxResponse (TmuxResponse)-import Chiasma.Data.View (viewIdent)-import qualified Chiasma.Data.View as Tmux (View (View))+import qualified Chiasma.Data.View as Tmux import Chiasma.Data.Views (Views (Views)) import Chiasma.Effect.Codec (Codec) import Chiasma.Effect.TmuxApi (TmuxApi)@@ -68,7 +67,7 @@ runRender tree = do   (Views _ _ viewsResult _) <- execState views (atomicStateToState (renderOnce tree))   panesResult <- withTmux (resumeHoist TmuxError.codec (windowPanes 1))-  pure (sortOn viewIdent viewsResult, sortOn paneLeft panesResult)+  pure (sortOn (.ident) viewsResult, sortOn (.paneLeft) panesResult)  renderTest ::   ViewTree ->
lib/Chiasma/Test/Tmux.hs view
@@ -221,7 +221,7 @@   stopToError $   mapError @CodecError @Text show $   stopToError $-  interpretLogStdoutLevelConc (Just (TmuxTestConfig.logLevel conf)) $+  interpretLogStdoutLevelConc (Just conf.logLevel) $   interpretTimeChronos do     withSystemTempDir (withTestTmux conf thunk) 
+ readme.md view
test/Chiasma/Test/LensTest.hs view
@@ -1,27 +1,28 @@ module Chiasma.Test.LensTest where -import Chiasma.Data.Ident (Ident(Str))+import Control.Lens (transformM)+import qualified Control.Lens as Lens (set)+import Hedgehog ((===))+import Test.Tasty (TestTree, testGroup)++import Chiasma.Data.Ident (Ident (Str)) import Chiasma.Lens.Tree (leafByIdent, modifyLeafByIdent, treesAndSubs)+import Chiasma.Test.Util (UnitTest, unitTest)+import qualified Chiasma.Ui.Data.View as View import Chiasma.Ui.Data.View (-  Pane(Pane),+  Pane (Pane),   PaneView,-  Tree(Tree),-  TreeSub(TreeNode, TreeLeaf),-  View(View),+  Tree (Tree),+  TreeSub (TreeLeaf, TreeNode),+  View (View),   ViewTree,   ViewTreeSub,   consLayout,   consPane,   )-import qualified Chiasma.Ui.Data.View as View (_ident, ident)-import Chiasma.Ui.Data.ViewState (ViewState(ViewState))+import Chiasma.Ui.Data.ViewState (ViewState (ViewState)) import Chiasma.Ui.ViewTree (togglePane)-import qualified Chiasma.Ui.ViewTree as ToggleResult (ToggleResult(..))-import Control.Lens (transformM)-import qualified Control.Lens as Lens (set)-import Hedgehog ((===))-import Test.Tasty (TestTree, testGroup)-import Chiasma.Test.Util (UnitTest, unitTest)+import qualified Chiasma.Ui.ViewTree as ToggleResult (ToggleResult (..))  id0, id1, id2, id3, id4 :: Ident id0 = Str "0"@@ -45,9 +46,9 @@ test_modify = do   let     ident = Str "changed"-    modded = modifyLeafByIdent id1 (Lens.set View.ident ident) tree+    modded = modifyLeafByIdent id1 (Lens.set #ident ident) tree   Nothing === leafByIdent ident tree-  Just ident === (View._ident <$> leafByIdent ident modded)+  Just ident === ((.ident) <$> leafByIdent ident modded)  failOnPaneIdent :: Ident -> ViewTree -> Maybe ViewTree failOnPaneIdent target t@(Tree _ sub) =@@ -63,7 +64,7 @@  insertPane :: Ident -> PaneView -> ViewTree -> ViewTree insertPane targetLayout pane (Tree l sub) =-  if View._ident l == targetLayout then Tree l (TreeLeaf pane : sub) else Tree l sub+  if l.ident == targetLayout then Tree l (TreeLeaf pane : sub) else Tree l sub  ensurePaneUnique :: Ident -> ViewTreeSub -> Maybe ViewTreeSub ensurePaneUnique paneIdent (TreeLeaf (View ident _ _ _)) | ident == paneIdent = Nothing