nvim-hs 2.2.0.0 → 2.2.0.1
raw patch · 2 files changed
+12/−6 lines, 2 filesdep ~template-haskell-compat-v0208PVP ok
version bump matches the API change (PVP)
Dependency ranges changed: template-haskell-compat-v0208
API changes (from Hackage documentation)
Files
- nvim-hs.cabal +1/−1
- test-suite/Neovim/EmbeddedRPCSpec.hs +11/−5
nvim-hs.cabal view
@@ -1,5 +1,5 @@ name: nvim-hs-version: 2.2.0.0+version: 2.2.0.1 synopsis: Haskell plugin backend for neovim description: This package provides a plugin provider for neovim. It allows you to write
test-suite/Neovim/EmbeddedRPCSpec.hs view
@@ -27,6 +27,11 @@ import System.Process.Typed +-- | Tests in here should always be wrapped in 'withNeovimEmbedded' because they+-- don't fail if neovim isn't installed. This is particularly helpful to run+-- tests on stackage and be notified if non-neovim-dependent tests fail.+-- Basically everybody else who runs these tests has neovim installed and would+-- see the test failing. spec :: Spec spec = parallel $ do let withNeovimEmbedded f a = testWithEmbeddedNeovim f (Seconds 3) () a@@ -66,11 +71,12 @@ q' <- vim_eval "getqflist()" liftIO $ fromObjectUnsafe q' `shouldBe` [q] - it "throws NeovimException with function that failed as Doc" $ do- let getUndefinedVariable = withNeovimEmbedded Nothing $ vim_get_var "notDefined"- getUndefinedVariable `shouldThrow` \case- ErrorResult f _ -> docToText f == "vim_get_var"- _ -> False+ it "throws NeovimException with function that failed as Doc" . withNeovimEmbedded Nothing $ do+ let getVariableValue = False <$ vim_get_var "notDefined"+ hasTrhownNeovimExceptionWithFunctionName <- getVariableValue `catchNeovimException` \case+ ErrorResult f _ -> pure $ docToText f == "vim_get_var"+ _ -> pure False+ liftIO $ hasTrhownNeovimExceptionWithFunctionName `shouldBe` True it "catches" . withNeovimEmbedded Nothing $ do let getUndefinedVariable = vim_get_var "notDefined"