diff options
author | Clint Adams <clint@debian.org> | 2016-01-11 21:36:33 -0500 |
---|---|---|
committer | Clint Adams <clint@debian.org> | 2016-01-11 21:36:33 -0500 |
commit | 67a314e0165f76d0f4ff2279c4dba226621bd61a (patch) | |
tree | 467db6c3916711ef9dc10bdfec6385bb9b0f0c04 /p/haskell-aeson | |
parent | e771d4a730d9a828bed2820e6306085494915d33 (diff) | |
download | DHG_packages-67a314e0165f76d0f4ff2279c4dba226621bd61a.tar.gz |
aeson: add missing test modules
Diffstat (limited to 'p/haskell-aeson')
-rw-r--r-- | p/haskell-aeson/debian/changelog | 6 | ||||
-rw-r--r-- | p/haskell-aeson/debian/patches/missing-test-modules | 105 | ||||
-rw-r--r-- | p/haskell-aeson/debian/patches/series | 1 |
3 files changed, 112 insertions, 0 deletions
diff --git a/p/haskell-aeson/debian/changelog b/p/haskell-aeson/debian/changelog index fd339a27d..9f36620fb 100644 --- a/p/haskell-aeson/debian/changelog +++ b/p/haskell-aeson/debian/changelog @@ -1,3 +1,9 @@ +haskell-aeson (0.10.0.0-2) unstable; urgency=medium + + * Add missing test modules. + + -- Clint Adams <clint@debian.org> Mon, 11 Jan 2016 21:36:22 -0500 + haskell-aeson (0.10.0.0-1) unstable; urgency=medium * New upstream release diff --git a/p/haskell-aeson/debian/patches/missing-test-modules b/p/haskell-aeson/debian/patches/missing-test-modules new file mode 100644 index 000000000..1e617c553 --- /dev/null +++ b/p/haskell-aeson/debian/patches/missing-test-modules @@ -0,0 +1,105 @@ +--- /dev/null ++++ b/tests/DataFamilies/Instances.hs +@@ -0,0 +1,27 @@ ++{-# LANGUAGE FlexibleInstances, TemplateHaskell, TypeFamilies #-} ++{-# OPTIONS_GHC -fno-warn-orphans #-} ++ ++module DataFamilies.Instances where ++ ++import Control.Applicative ++import Data.Aeson.TH ++import DataFamilies.Types ++import Test.QuickCheck (Arbitrary(..), elements, oneof) ++import Prelude ++ ++instance (Arbitrary a) => Arbitrary (Approx a) where ++ arbitrary = Approx <$> arbitrary ++ ++instance Arbitrary (Nullary Int) where ++ arbitrary = elements [C1, C2, C3] ++ ++instance Arbitrary a => Arbitrary (SomeType c () a) where ++ arbitrary = oneof [ pure Nullary ++ , Unary <$> arbitrary ++ , Product <$> arbitrary <*> arbitrary <*> arbitrary ++ , Record <$> arbitrary <*> arbitrary <*> arbitrary ++ ] ++ ++deriveJSON defaultOptions 'C1 ++deriveJSON defaultOptions 'Nullary ++deriveJSON defaultOptions 'Approx +--- /dev/null ++++ b/tests/DataFamilies/Properties.hs +@@ -0,0 +1,72 @@ ++module DataFamilies.Properties (tests) where ++ ++import DataFamilies.Encoders ++import DataFamilies.Instances () ++ ++import Properties hiding (tests) ++ ++import Test.Framework (Test, testGroup) ++import Test.Framework.Providers.QuickCheck2 (testProperty) ++ ++-------------------------------------------------------------------------------- ++ ++tests :: Test ++tests = testGroup "data families" [ ++ testGroup "template-haskell" [ ++ testGroup "toJSON" [ ++ testGroup "Nullary" [ ++ testProperty "string" (isString . thNullaryToJSONString) ++ , testProperty "2ElemArray" (is2ElemArray . thNullaryToJSON2ElemArray) ++ , testProperty "TaggedObject" (isTaggedObjectValue . thNullaryToJSONTaggedObject) ++ , testProperty "ObjectWithSingleField" (isObjectWithSingleField . thNullaryToJSONObjectWithSingleField) ++ ++ , testGroup "roundTrip" [ ++ testProperty "string" (toParseJSON thNullaryParseJSONString thNullaryToJSONString) ++ , testProperty "2ElemArray" (toParseJSON thNullaryParseJSON2ElemArray thNullaryToJSON2ElemArray) ++ , testProperty "TaggedObject" (toParseJSON thNullaryParseJSONTaggedObject thNullaryToJSONTaggedObject) ++ , testProperty "ObjectWithSingleField" (toParseJSON thNullaryParseJSONObjectWithSingleField thNullaryToJSONObjectWithSingleField) ++ ] ++ ] ++ , testGroup "SomeType" [ ++ testProperty "2ElemArray" (is2ElemArray . thSomeTypeToJSON2ElemArray) ++ , testProperty "TaggedObject" (isTaggedObject . thSomeTypeToJSONTaggedObject) ++ , testProperty "ObjectWithSingleField" (isObjectWithSingleField . thSomeTypeToJSONObjectWithSingleField) ++ , testGroup "roundTrip" [ ++ testProperty "2ElemArray" (toParseJSON thSomeTypeParseJSON2ElemArray thSomeTypeToJSON2ElemArray) ++ , testProperty "TaggedObject" (toParseJSON thSomeTypeParseJSONTaggedObject thSomeTypeToJSONTaggedObject) ++ , testProperty "ObjectWithSingleField" (toParseJSON thSomeTypeParseJSONObjectWithSingleField thSomeTypeToJSONObjectWithSingleField) ++ ] ++ , testGroup "Approx" [ ++ testProperty "string" (isString . thApproxToJSONUnwrap) ++ , testProperty "ObjectWithSingleField" (isObjectWithSingleField . thApproxToJSONDefault) ++ , testGroup "roundTrip" [ ++ testProperty "string" (toParseJSON thApproxParseJSONUnwrap thApproxToJSONUnwrap) ++ , testProperty "ObjectWithSingleField" (toParseJSON thApproxParseJSONDefault thApproxToJSONDefault) ++ ] ++ ] ++ ] ++ ] ++ , testGroup "toEncoding" [ ++ testProperty "NullaryString" $ ++ thNullaryToJSONString `sameAs` thNullaryToEncodingString ++ , testProperty "Nullary2ElemArray" $ ++ thNullaryToJSON2ElemArray `sameAs` thNullaryToEncoding2ElemArray ++ , testProperty "NullaryTaggedObject" $ ++ thNullaryToJSONTaggedObject `sameAs` thNullaryToEncodingTaggedObject ++ , testProperty "NullaryObjectWithSingleField" $ ++ thNullaryToJSONObjectWithSingleField `sameAs` ++ thNullaryToEncodingObjectWithSingleField ++ , testProperty "ApproxUnwrap" $ ++ thApproxToJSONUnwrap `sameAs` thApproxToEncodingUnwrap ++ , testProperty "ApproxDefault" $ ++ thApproxToJSONDefault `sameAs` thApproxToEncodingDefault ++ , testProperty "SomeType2ElemArray" $ ++ thSomeTypeToJSON2ElemArray `sameAsV` thSomeTypeToEncoding2ElemArray ++ , testProperty "SomeTypeTaggedObject" $ ++ thSomeTypeToJSONTaggedObject `sameAsV` thSomeTypeToEncodingTaggedObject ++ , testProperty "SomeTypeObjectWithSingleField" $ ++ thSomeTypeToJSONObjectWithSingleField `sameAsV` ++ thSomeTypeToEncodingObjectWithSingleField ++ ] ++ ] ++ ] diff --git a/p/haskell-aeson/debian/patches/series b/p/haskell-aeson/debian/patches/series index 79ecbcd96..c9ee15629 100644 --- a/p/haskell-aeson/debian/patches/series +++ b/p/haskell-aeson/debian/patches/series @@ -1,2 +1,3 @@ th-option.diff threaded-option.diff +missing-test-modules |