packages feed

tomland 1.0.0 → 1.0.1.0

raw patch · 10 files changed

+192/−86 lines, 10 filesdep ~basedep ~hedgehogdep ~tasty-hedgehogPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base, hedgehog, tasty-hedgehog

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -3,6 +3,14 @@ tomland uses [PVP Versioning][1]. The changelog is available [on GitHub][2]. +## 1.0.1.0 — May 17, 2019++* [#177](https://github.com/kowainik/tomland/issues/177):+  Add a more extensive property generator for `Piece`.+* [#187](https://github.com/kowainik/tomland/issues/187):+  Bump up to `hedgehog-1.0`.+* Support GHC 8.6.5+ ## 1.0.0 — Jan 14, 2019  * [#13](https://github.com/kowainik/tomland/issues/13):
README.lhs view
@@ -1,8 +1,8 @@ # tomland  ![palm](https://user-images.githubusercontent.com/4276606/51088259-7a777000-176e-11e9-9d76-6be4023c0ac3.png)-[![Build status](https://secure.travis-ci.org/kowainik/tomland.svg)](https://travis-ci.org/kowainik/tomland)-[![Hackage](https://img.shields.io/hackage/v/tomland.svg)](https://hackage.haskell.org/package/tomland)+[![Build status](https://img.shields.io/travis/kowainik/tomland.svg?logo=travis)](https://travis-ci.org/kowainik/tomland)+[![Hackage](https://img.shields.io/hackage/v/tomland.svg?logo=haskell)](https://hackage.haskell.org/package/tomland) [![Stackage LTS](http://stackage.org/package/tomland/badge/lts)](http://stackage.org/lts/package/tomland) [![Stackage Nightly](http://stackage.org/package/tomland/badge/nightly)](http://stackage.org/nightly/package/tomland) [![MPL-2.0 license](https://img.shields.io/badge/license-MPL--2.0-blue.svg)](https://github.com/kowainik/tomland/blob/master/LICENSE)
README.md view
@@ -1,8 +1,8 @@ # tomland  ![palm](https://user-images.githubusercontent.com/4276606/51088259-7a777000-176e-11e9-9d76-6be4023c0ac3.png)-[![Build status](https://secure.travis-ci.org/kowainik/tomland.svg)](https://travis-ci.org/kowainik/tomland)-[![Hackage](https://img.shields.io/hackage/v/tomland.svg)](https://hackage.haskell.org/package/tomland)+[![Build status](https://img.shields.io/travis/kowainik/tomland.svg?logo=travis)](https://travis-ci.org/kowainik/tomland)+[![Hackage](https://img.shields.io/hackage/v/tomland.svg?logo=haskell)](https://hackage.haskell.org/package/tomland) [![Stackage LTS](http://stackage.org/package/tomland/badge/lts)](http://stackage.org/lts/package/tomland) [![Stackage Nightly](http://stackage.org/package/tomland/badge/nightly)](http://stackage.org/nightly/package/tomland) [![MPL-2.0 license](https://img.shields.io/badge/license-MPL--2.0-blue.svg)](https://github.com/kowainik/tomland/blob/master/LICENSE)
src/Toml/Type/Value.hs view
@@ -213,7 +213,7 @@ eqValueList _ _ = False  -- | Reifies type of 'Value' into 'TValue'. Unfortunately, there's no way to--- guarante that 'valueType' will return @t@ for object with type @Value \'t@.+-- guarantee that 'valueType' will return @t@ for object with type @Value \'t@. valueType :: Value t -> TValue valueType (Bool _)    = TBool valueType (Integer _) = TInteger
test/Test/Toml/Gen.hs view
@@ -2,6 +2,7 @@ {-# LANGUAGE PatternSynonyms     #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications    #-}+{-# LANGUAGE TypeFamilies        #-}  -- | This module contains all generators for @tomland@ testing. @@ -52,6 +53,7 @@ import Control.Monad (forM, replicateM) import Data.ByteString (ByteString) import Data.Fixed (Fixed (..))+import Data.Functor.Identity (Identity) import Data.Hashable (Hashable) import Data.HashSet (HashSet) import Data.IntSet (IntSet)@@ -61,7 +63,7 @@                   minutesToTimeZone) import GHC.Exts (fromList) import GHC.Stack (HasCallStack)-import Hedgehog (Gen, MonadGen, PropertyT, Range, property)+import Hedgehog (Gen, GenBase, MonadGen, PropertyT, Range, property) import Numeric.Natural (Natural) import Test.Tasty (TestName, TestTree) import Test.Tasty.Hedgehog (testProperty)@@ -71,6 +73,7 @@ import Toml.Type (AnyValue (..), TOML (..), TValue (..), Value (..))  import qualified Data.ByteString.Lazy as LB+import qualified Data.Char as Char import qualified Data.List.NonEmpty as NE import qualified Data.Text as Text import qualified Data.Text.Lazy as L@@ -103,25 +106,43 @@ genAnyValue = Gen.choice $     (AnyValue <$> genArray) : noneArrayList --- [#177]: see issue here: https://github.com/kowainik/tomland/issues/177-genPiece :: MonadGen m => m Piece-genPiece = Piece <$> Gen.text (Range.constant 1 50) Gen.alphaNum+-- | Generate either a bare piece, or a quoted piece+genPiece :: forall m . (MonadGen m, GenBase m ~ Identity) => m Piece+genPiece = Piece <$> Gen.choice [bare, quoted]+  where+    alphadashes :: m Char+    alphadashes = Gen.choice [Gen.alphaNum, Gen.element "_-"] -genKey :: MonadGen m => m Key+    notControl :: m Char+    notControl = Gen.filter (not . Char.isControl) Gen.unicode++    bare :: m Text+    bare = Gen.text (Range.constant 1 10) alphadashes++    wrapChar :: Char -> Text -> Text+    wrapChar c = Text.cons c . (`Text.append` Text.singleton c)++    quotedWith :: Char -> m Text+    quotedWith c = wrapChar c <$> Gen.text (Range.constant 1 10) (Gen.filter (/= c) notControl)++    quoted :: m Text+    quoted = Gen.choice [quotedWith '"', quotedWith '\'']++genKey :: (MonadGen m, GenBase m ~ Identity) => m Key genKey = Key <$> Gen.nonEmpty (Range.constant 1 10) genPiece -genKeyAnyValue :: MonadGen m => m (Key, AnyValue)+genKeyAnyValue :: (MonadGen m, GenBase m ~ Identity) => m (Key, AnyValue) genKeyAnyValue = liftA2 (,) genKey genAnyValue -genKeyAnyValueList :: MonadGen m => m [(Key, AnyValue)]+genKeyAnyValueList :: (MonadGen m, GenBase m ~ Identity) => m [(Key, AnyValue)] genKeyAnyValueList = Gen.list (Range.linear 0 10) genKeyAnyValue  -- Generates key-value pair for PrefixMap-genEntry :: MonadGen m => m (Piece, Key)+genEntry :: (MonadGen m, GenBase m ~ Identity) => m (Piece, Key) genEntry = genKey >>= \case     key@(piece :|| _) -> pure (piece, key) -genPrefixMap :: MonadGen m => m (PrefixMap V)+genPrefixMap :: (MonadGen m, GenBase m ~ Identity) => m (PrefixMap V) genPrefixMap = do     entries <- Gen.list (Range.linear 0 10) genEntry     kvps    <- forM entries $ \(piece, key) -> do@@ -130,7 +151,7 @@      pure $ fromList kvps -genPrefixTree :: forall m . MonadGen m => Key -> m (PrefixTree V)+genPrefixTree :: forall m . (MonadGen m, GenBase m ~ Identity) => Key -> m (PrefixTree V) genPrefixTree key = Gen.recursive     -- list picker generator combinator     Gen.choice@@ -147,7 +168,7 @@ makeToml :: [(Key, AnyValue)] -> TOML makeToml kv = TOML (fromList kv) mempty mempty -genToml :: MonadGen m => m TOML+genToml :: (MonadGen m, GenBase m ~ Identity) => m TOML genToml = Gen.recursive             Gen.choice             [ makeToml <$> genKeyAnyValueList ]
+ test/golden/pretty_default.golden view
@@ -0,0 +1,26 @@+a = "a"+b = "bb"+c = "cccc"+d = "ddd"++[baz]++[doo]++[foo]++[qux.doo]+  egg = "?"+  spam = "!"++[[deeper]]+  green = true++[[deeper]]+  [deeper.blue]+    red = 255++[[deepest]]+  ping = "pong"++[[deepest]]
+ test/golden/pretty_indented_only.golden view
@@ -0,0 +1,26 @@+a = "a"+c = "cccc"+d = "ddd"+b = "bb"++[doo]++[foo]++[baz]++[qux.doo]+    egg = "?"+    spam = "!"++[[deeper]]+    green = true++[[deeper]]+    [deeper.blue]+        red = 255++[[deepest]]+    ping = "pong"++[[deepest]]
+ test/golden/pretty_sorted_only.golden view
@@ -0,0 +1,26 @@+a = "a"+b = "bb"+c = "cccc"+d = "ddd"++[baz]++[doo]++[foo]++[qux.doo]+egg = "?"+spam = "!"++[[deeper]]+green = true++[[deeper]]+[deeper.blue]+red = 255++[[deepest]]+ping = "pong"++[[deepest]]
+ test/golden/pretty_unformatted.golden view
@@ -0,0 +1,26 @@+a = "a"+c = "cccc"+d = "ddd"+b = "bb"++[doo]++[foo]++[baz]++[qux.doo]+egg = "?"+spam = "!"++[[deeper]]+green = true++[[deeper]]+[deeper.blue]+red = 255++[[deepest]]+ping = "pong"++[[deepest]]
tomland.cabal view
@@ -1,6 +1,6 @@-cabal-version:       2.0+cabal-version:       2.4 name:                tomland-version:             1.0.0+version:             1.0.1.0 synopsis:            Bidirectional TOML serialization description:     Implementation of bidirectional TOML serialization. Simple codecs look like this:@@ -25,23 +25,46 @@ bug-reports:         https://github.com/kowainik/tomland/issues license:             MPL-2.0 license-file:        LICENSE-author:              Kowainik-maintainer:          xrom.xkov@gmail.com-copyright:           2018-present Kowainik+author:              Dmitrii Kovanikov, Veronika Romashkina+maintainer:          Kowainik <xrom.xkov@gmail.com>+copyright:           2018-2019 Kowainik category:            TOML, Text, Configuration build-type:          Simple extra-doc-files:     README.md                    , CHANGELOG.md-data-dir:            test/golden+extra-source-files:  test/golden/*.golden tested-with:         GHC == 8.2.2                    , GHC == 8.4.4-                   , GHC == 8.6.3+                   , GHC == 8.6.5  source-repository head   type:                git   location:            https://github.com/kowainik/tomland.git +common common-options+  build-depends:       base >= 4.10 && < 4.13++  ghc-options:         -Wall+                       -Wincomplete-uni-patterns+                       -Wincomplete-record-updates+                       -Wcompat+                       -Widentities+                       -Wredundant-constraints+                       -Wpartial-fields+                       -fhide-source-paths+                       -freverse-errors++  default-language:    Haskell2010+  default-extensions:  DeriveGeneric+                       InstanceSigs+                       LambdaCase+                       OverloadedStrings+                       RecordWildCards+                       ScopedTypeVariables+                       TypeApplications+ library+  import:              common-options   hs-source-dirs:      src    exposed-modules:     Toml@@ -64,8 +87,7 @@                            Toml.Type.UValue                            Toml.Type.Value -  build-depends:       base >= 4.10 && < 4.13-                     , bytestring ^>= 0.10+  build-depends:       bytestring ^>= 0.10                      , containers >= 0.5.7 && < 0.7                      , deepseq ^>= 1.4                      , hashable ^>= 1.2@@ -77,51 +99,28 @@                      , transformers ^>= 0.5                      , unordered-containers ^>= 0.2.7 -  ghc-options:         -Wall-                       -Wincomplete-uni-patterns-                       -Wincomplete-record-updates-                       -Wcompat-                       -Widentities-                       -Wredundant-constraints-                       -fhide-source-paths-                       -Wmissing-export-lists-                       -Wpartial-fields--  default-language:    Haskell2010-  default-extensions:  DeriveGeneric-                       InstanceSigs-                       LambdaCase-                       OverloadedStrings-                       RecordWildCards-                       ScopedTypeVariables-                       TypeApplications- executable readme+  import:              common-options   main-is:             README.lhs-  build-depends:       base-                     , text+  build-depends:       text                      , tomland    build-tool-depends:  markdown-unlit:markdown-unlit-  ghc-options:         -Wall -pgmL markdown-unlit-  default-language:    Haskell2010+  ghc-options:         -pgmL markdown-unlit  executable play-tomland+  import:              common-options   main-is:             Playground.hs-  build-depends:       base-                     , tomland+  build-depends:       tomland                      , text                      , time                      , unordered-containers    hs-source-dirs:      examples-  default-language:    Haskell2010   ghc-options:         -threaded -Wall-                       -freverse-errors-  default-extensions:  OverloadedStrings-                       RecordWildCards  test-suite tomland-test+  import:              common-options   type:                exitcode-stdio-1.0   hs-source-dirs:      test   main-is:             Spec.hs@@ -138,15 +137,14 @@                        Test.Toml.TOML.Property    build-tool-depends:  tasty-discover:tasty-discover ^>= 4.2.1-  build-depends:       base-                     , bytestring ^>= 0.10+  build-depends:       bytestring ^>= 0.10                      , containers >= 0.5.7 && < 0.7                      , hashable-                     , hedgehog ^>= 0.6+                     , hedgehog ^>= 1.0                      , hspec-megaparsec                      , megaparsec                      , tasty ^>= 1.2-                     , tasty-hedgehog ^>= 0.2.0.0+                     , tasty-hedgehog ^>= 1.0.0.0                      , tasty-hspec ^>= 1.1.5.1                      , tasty-silver ^>= 3.1.11                      , text@@ -154,20 +152,10 @@                      , tomland                      , unordered-containers -  ghc-options:         -Wall -threaded -rtsopts -with-rtsopts=-N-                       -Wincomplete-uni-patterns-                       -Wincomplete-record-updates-                       -Wcompat-                       -Widentities-                       -fhide-source-paths-                       -Wpartial-fields--  default-language:    Haskell2010-  default-extensions:  LambdaCase-                       OverloadedStrings-                       RecordWildCards+  ghc-options:         -threaded -rtsopts -with-rtsopts=-N  benchmark tomland-benchmark+  import:             common-options   type:               exitcode-stdio-1.0   main-is:            Main.hs   hs-source-dirs:     benchmark@@ -178,19 +166,10 @@                       Benchmark.Tomland                       Benchmark.TomlParser -  ghc-options:        -Wall-                      -threaded+  ghc-options:        -threaded                       -rtsopts                       -with-rtsopts=-N                       -O2-                      -Wincomplete-uni-patterns-                      -Wincomplete-record-updates-                      -Wcompat-                      -Widentities-                      -Wredundant-constraints-                      -fhide-source-paths-                      -Wmissing-export-lists-                      -Wpartial-fields    build-depends:      base                     , aeson@@ -203,9 +182,3 @@                     , time                     , toml-parser ^>= 0.1.0.0                     , tomland--  default-language:   Haskell2010--  default-extensions:  LambdaCase-                       OverloadedStrings-                       RecordWildCards