Codebase list haskell-xss-sanitize / a679aea
haskell-persistent-template: New upstream version 0.8.1.1. Clint Adams 12 years ago
6 changed file(s) with 80 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
0 haskell-persistent-template (0.8.1.1-1) unstable; urgency=low
1
2 * New upstream version.
3 * Bump to Standards-Version 3.9.3.
4 * Enable test suite, with test suite lifted from git.
5
6 -- Clint Adams <clint@debian.org> Wed, 29 Feb 2012 10:52:09 -0500
7
08 haskell-persistent-template (0.6.3.1-1) unstable; urgency=low
19
210 * New upstream version.
88 , ghc
99 , ghc-prof
1010 , ghc-ghci
11 , libghc-aeson-dev
12 , libghc-aeson-prof
1113 , libghc-monad-control-dev (>> 0.2)
1214 , libghc-monad-control-dev (<< 0.4)
1315 , libghc-monad-control-prof
14 , libghc-persistent-dev (>= 0.6.2)
15 , libghc-persistent-dev (<< 0.7)
16 , libghc-persistent-dev (>> 0.8)
17 , libghc-persistent-dev (<< 0.9)
1618 , libghc-persistent-prof
1719 , libghc-text-dev (>> 0.5)
1820 , libghc-text-dev (<< 1.0)
1921 , libghc-text-prof
2022 , libghc-transformers-dev (>> 0.2)
2123 , libghc-transformers-prof
24 , libghc-hspec-dev
25 , libghc-hunit-dev
26 , libghc-quickcheck2-dev
2227 Build-Depends-Indep: ghc-doc
28 , libghc-aeson-doc
2329 , libghc-monad-control-doc
2430 , libghc-persistent-doc
2531 , libghc-text-doc
2632 , libghc-transformers-doc
27 Standards-Version: 3.9.2
33 Standards-Version: 3.9.3
2834 Homepage: http://hackage.haskell.org/package/persistent-template
2935 Vcs-Darcs: http://darcs.debian.org/pkg-haskell/haskell-persistent-template
3036 Vcs-Browser: http://darcs.debian.org/cgi-bin/darcsweb.cgi?r=pkg-haskell/haskell-persistent-template
0 testsuite.diff
1 testsuite-fix.diff
0 --- a/test/main.hs
1 +++ b/test/main.hs
2 @@ -1,4 +1,4 @@
3 -{-# LANGUAGE OverloadedStrings, QuasiQuotes, TemplateHaskell, TypeFamilies, GADTs #-}
4 +{-# LANGUAGE OverloadedStrings, QuasiQuotes, TemplateHaskell, TypeFamilies, GADTs, EmptyDataDecls #-}
5 import Test.Hspec.Monadic
6 import Test.Hspec.QuickCheck
7 import Test.Hspec.HUnit()
0 --- /dev/null
1 +++ b/test/main.hs
2 @@ -0,0 +1,48 @@
3 +{-# LANGUAGE OverloadedStrings, QuasiQuotes, TemplateHaskell, TypeFamilies, GADTs #-}
4 +import Test.Hspec.Monadic
5 +import Test.Hspec.QuickCheck
6 +import Test.Hspec.HUnit()
7 +import Test.HUnit
8 +import Data.ByteString.Lazy.Char8 ()
9 +import Test.QuickCheck.Arbitrary
10 +import Control.Applicative ((<$>), (<*>))
11 +
12 +import Database.Persist
13 +import Database.Persist.TH
14 +import Data.Text (Text, pack)
15 +import Data.Aeson
16 +
17 +mkPersist sqlSettings [persistUpperCase|
18 +Person json
19 +    name Text
20 +    age Int Maybe
21 +    address Address
22 +Address json
23 +    street Text
24 +    city Text
25 +    zip Int Maybe
26 +NoJson
27 +    foo Text
28 +|]
29 +
30 +-- ensure no-json works
31 +instance ToJSON (NoJsonGeneric b) where
32 +    toJSON = undefined
33 +instance FromJSON (NoJsonGeneric b) where
34 +    parseJSON = undefined
35 +
36 +arbitraryT = pack <$> arbitrary
37 +
38 +instance Arbitrary (PersonGeneric b) where
39 +    arbitrary = Person <$> arbitraryT <*> arbitrary <*> arbitrary
40 +instance Arbitrary (AddressGeneric b) where
41 +    arbitrary = Address <$> arbitraryT <*> arbitraryT <*> arbitrary
42 +
43 +main :: IO ()
44 +main = hspecX $ do
45 +    describe "JSON serialization" $ do
46 +        prop "to/from is idempotent" $ \person ->
47 +            decode (encode person) == Just (person :: Person)
48 +        it "decode" $
49 +            decode "{\"name\":\"Michael\",\"age\":27,\"address\":{\"street\":\"Narkis\",\"city\":\"Maalot\"}}" @?= Just
50 +                (Person "Michael" (Just 27) $ Address "Narkis" "Maalot" Nothing)
00 #!/usr/bin/make -f
1
2 DEB_ENABLE_TESTS = yes
13
24 include /usr/share/cdbs/1/rules/debhelper.mk
35 include /usr/share/cdbs/1/class/hlibrary.mk