[DHG_packages] 03/03: aeson: add missing test modules

Clint Adams clint at moszumanska.debian.org
Tue Jan 12 03:06:51 UTC 2016


This is an automated email from the git hooks/post-receive script.

clint pushed a commit to branch master
in repository DHG_packages.

commit 67a314e0165f76d0f4ff2279c4dba226621bd61a
Author: Clint Adams <clint at debian.org>
Date:   Mon Jan 11 21:36:33 2016 -0500

    aeson: add missing test modules
---
 p/haskell-aeson/debian/changelog                   |   6 ++
 .../debian/patches/missing-test-modules            | 105 +++++++++++++++++++++
 p/haskell-aeson/debian/patches/series              |   1 +
 3 files changed, 112 insertions(+)

diff --git a/p/haskell-aeson/debian/changelog b/p/haskell-aeson/debian/changelog
index fd339a2..9f36620 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 at 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 0000000..1e617c5
--- /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 79ecbcd..c9ee156 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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-haskell/DHG_packages.git



More information about the Pkg-haskell-commits mailing list