From 75d9fe614dca572aa1d7cfa53553e9c103eb2dd0 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 25 Jan 2017 15:54:54 +0100 Subject: Cleanup test suite --- spec/src/Thermoprint/Printout.hs | 11 ++++++++--- spec/thermoprint-spec.cabal | 2 +- spec/thermoprint-spec.nix | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) (limited to 'spec') diff --git a/spec/src/Thermoprint/Printout.hs b/spec/src/Thermoprint/Printout.hs index 752ccb5..53b6a3e 100644 --- a/spec/src/Thermoprint/Printout.hs +++ b/spec/src/Thermoprint/Printout.hs @@ -37,7 +37,7 @@ import Data.Proxy (Proxy(..)) import Test.QuickCheck.Arbitrary (Arbitrary(..), CoArbitrary, genericShrink) import Test.QuickCheck.Modifiers (NonNegative(..)) -import Test.QuickCheck.Gen (oneof, scale) +import Test.QuickCheck.Gen (oneof, scale, elements) import Test.QuickCheck.Instances import Test.QuickCheck (forAll, Property) @@ -242,10 +242,14 @@ data MarkupMode = Bold | Underline | DoubleHeight | DoubleWidth - deriving (Generic, NFData, Show, Arbitrary, CoArbitrary, FromJSON, ToJSON - , Eq, Ord, Enum + deriving (Generic, NFData, Show, FromJSON, ToJSON + , Eq, Ord, Enum, Bounded ) +instance Arbitrary MarkupMode where + arbitrary = elements [minBound..maxBound] +instance CoArbitrary MarkupMode + -- | We don't test 'Raw' 'Chunk's instance Arbitrary Chunk where shrink = genericShrink @@ -262,6 +266,7 @@ instance Arbitrary Line where shrink = genericShrink arbitrary = oneof [ Word . TL.filter (not . isSpace) <$> arbitrary -- 'isSpace '\n' == True' , HSpace . getNonNegative <$> arbitrary + , Markup <$> arbitrary <*> arbitrary , JuxtaPos <$> scale' arbitrary ] diff --git a/spec/thermoprint-spec.cabal b/spec/thermoprint-spec.cabal index d4ecda6..138a06e 100644 --- a/spec/thermoprint-spec.cabal +++ b/spec/thermoprint-spec.cabal @@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: thermoprint-spec -version: 5.0.0 +version: 5.0.1 synopsis: A specification of the API and the payload datatypes and associated utilities -- description: homepage: http://dirty-haskell.org/tags/thermoprint.html diff --git a/spec/thermoprint-spec.nix b/spec/thermoprint-spec.nix index 1a1611c..a3093de 100644 --- a/spec/thermoprint-spec.nix +++ b/spec/thermoprint-spec.nix @@ -4,7 +4,7 @@ }: mkDerivation { pname = "thermoprint-spec"; - version = "5.0.0"; + version = "5.0.1"; src = ./.; libraryHaskellDepends = [ aeson base base64-bytestring bytestring Cabal cabal-test-quickcheck -- cgit v1.2.3