richenv 0.1.0.1 → 0.1.0.2
raw patch · 4 files changed
+30/−21 lines, 4 filesdep +HsYAMLdep +HsYAML-aesondep −yamldep ~QuickCheckdep ~aesondep ~basePVP ok
version bump matches the API change (PVP)
Dependencies added: HsYAML, HsYAML-aeson
Dependencies removed: yaml
Dependency ranges changed: QuickCheck, aeson, base, unordered-containers
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- README.md +5/−2
- richenv.cabal +13/−12
- test/RichEnvSpec.hs +8/−7
CHANGELOG.md view
@@ -1,5 +1,9 @@ # Revision history for richenv +## 0.1.0.2 -- 2024-05-20++* test: switch dependency for YAML parsing from `yaml` to `HsYAML`.+ ## 0.1.0.1 -- 2023-09-25 * Fix changelog.
README.md view
@@ -1,10 +1,13 @@ # RichEnv [](https://github.com/DavSanchez/richenv/actions/workflows/tests.yml)+ [](https://hackage.haskell.org/package/richenv)-<!-- [](https://stackage.org/lts/package/richenv) [](https://stackage.org/nightly/package/richenv)-[](https://search.nixos.org/packages?size=1&show=richenv) -->+[](https://stackage.org/lts/package/richenv)++[](https://search.nixos.org/packages?size=1&show=richenv&channel=unstable)+[](https://search.nixos.org/packages?size=1&show=richenv) Rich environment variable setup for Haskell
richenv.cabal view
@@ -21,7 +21,7 @@ -- PVP summary: +-+------- breaking API changes -- | | +----- non-breaking API additions -- | | | +--- code changes with no API change-version: 0.1.0.1+version: 0.1.0.2 -- A short (one-line) description of the package. synopsis: Rich environment variable setup for Haskell@@ -46,7 +46,7 @@ maintainer: davidslt+git@pm.me -- A copyright notice.-copyright: 2023 David Sánchez+copyright: 2024 David Sánchez category: Configuration build-type: Simple @@ -58,7 +58,7 @@ -- Extra source files to be distributed with the package, such as examples, or a tutorial module. -- extra-source-files: -tested-with: GHC ==9.2.8 || ==9.4.6+tested-with: GHC ==9.4.8 || ==9.6.5 || ==9.8.2 || ==9.10.1 source-repository head type: git@@ -66,10 +66,10 @@ common common-options build-depends:- , aeson >=2.1.0 && <2.3- , base >=4.14 && <5- , text >=2.0 && <3- , unordered-containers >=0.2.19 && <0.3+ , aeson >=2.1.2.1 && <2.3+ , base >=4.17 && <5+ , text >=2.0 && <3+ , unordered-containers >=0.2.20 && <0.3 ghc-options: -Wall -Wcompat -Widentities -Wincomplete-uni-patterns@@ -158,12 +158,13 @@ -- Test dependencies. build-depends: , aeson- , bytestring >=0.11 && <0.13- , hspec >=2.10 && <2.12- , QuickCheck >=2.14 && <2.15- , quickcheck-instances >=0.3.29 && <0.4+ , bytestring >=0.11 && <0.13+ , hspec >=2.10 && <2.12+ , HsYAML >=0.2.1.3 && <0.3+ , HsYAML-aeson >=0.2.0.1 && <0.3+ , QuickCheck >=2.14 && <2.16+ , quickcheck-instances >=0.3.29 && <0.4 , richenv- , yaml >=0.11 && <0.12 -- , process >=1.6 && <1.7 build-tool-depends: hspec-discover:hspec-discover
test/RichEnvSpec.hs view
@@ -1,14 +1,14 @@ module RichEnvSpec (spec) where import ArbitraryInstances ()-import Control.Exception (displayException) import Data.Aeson qualified as JSON import Data.ByteString qualified as B import Data.ByteString.Char8 qualified as C8 import Data.HashMap.Strict qualified as HM import Data.List (sort) import Data.Text qualified as T-import Data.Yaml qualified as Yaml+import Data.YAML (Pos)+import Data.YAML.Aeson qualified as Yaml import GHC.Generics (Generic) import RichEnv (clearEnvironment, setRichEnvFromCurrent, toEnvListFromCurrent) import RichEnv.Types (Environment, Mappings (Mappings), Prefixes (Prefixes), RichEnv (..), Values (Values), defaultRichEnv, fromEnvironment, toEnvironment)@@ -75,9 +75,9 @@ context "working with YAML" $ it "parses a YAML file into expected results" $ do clearEnv setTestEnv fileTestsBaseEnv- let res = Yaml.decodeEither' yamlTestCase :: Either Yaml.ParseException TestType+ let res = Yaml.decode1Strict yamlTestCase case res of- Left err -> fail $ show err+ Left err -> fail $ "Parse failed. State: " <> show err Right actual -> testEnvList fileTestsCaseExpected (environ actual) context "working with JSON" $ it "parses a JSON file into expected results" $ do@@ -90,10 +90,11 @@ context "invariants" $ do prop "parsing YAML from and to a RichEnv should end in the original value" $ \re -> do- let yaml = Yaml.encode re- res = Yaml.decodeEither' yaml :: Either Yaml.ParseException RichEnv+ let yaml = Yaml.encode1Strict re+ C8.writeFile "./testcase.yaml" yaml+ let res = Yaml.decode1Strict yaml :: Either (Pos, String) RichEnv in case res of- Left err -> fail $ displayException err+ Left err -> fail $ "Parse failed. State: " <> show err Right actual -> do actual `shouldBe` re prop "parsing JSON from and to a RichEnv should end in the original value" $ \re -> do