Hello community,
here is the log from the commit of package ghc-persistable-record for
openSUSE:Factory checked in at 2017-03-14 10:05:43
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-persistable-record (Old)
and /work/SRC/openSUSE:Factory/.ghc-persistable-record.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-persistable-record"
Tue Mar 14 10:05:43 2017 rev:3 rq:461670 version:0.4.1.1
Changes:
--------
---
/work/SRC/openSUSE:Factory/ghc-persistable-record/ghc-persistable-record.changes
2017-02-03 17:39:35.320671284 +0100
+++
/work/SRC/openSUSE:Factory/.ghc-persistable-record.new/ghc-persistable-record.changes
2017-03-14 10:05:44.223258660 +0100
@@ -1,0 +2,5 @@
+Mon Feb 20 08:43:05 UTC 2017 - [email protected]
+
+- Update to version 0.4.1.1 with cabal2obs.
+
+-------------------------------------------------------------------
Old:
----
persistable-record-0.4.1.0.tar.gz
New:
----
persistable-record-0.4.1.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-persistable-record.spec ++++++
--- /var/tmp/diff_new_pack.rgHyim/_old 2017-03-14 10:05:44.799177110 +0100
+++ /var/tmp/diff_new_pack.rgHyim/_new 2017-03-14 10:05:44.803176544 +0100
@@ -1,7 +1,7 @@
#
# spec file for package ghc-persistable-record
#
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,8 +17,9 @@
%global pkg_name persistable-record
+%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.4.1.0
+Version: 0.4.1.1
Release: 0
Summary: Binding between SQL database values and haskell records
License: BSD-3-Clause
@@ -35,6 +36,9 @@
BuildRequires: ghc-th-data-compat-devel
BuildRequires: ghc-transformers-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
+%if %{with tests}
+BuildRequires: ghc-quickcheck-simple-devel
+%endif
%description
This package contiains types to represent table constraints and interfaces to
@@ -61,6 +65,9 @@
%install
%ghc_lib_install
+%check
+%cabal_test
+
%post devel
%ghc_pkg_recache
++++++ persistable-record-0.4.1.0.tar.gz -> persistable-record-0.4.1.1.tar.gz
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/persistable-record-0.4.1.0/persistable-record.cabal
new/persistable-record-0.4.1.1/persistable-record.cabal
--- old/persistable-record-0.4.1.0/persistable-record.cabal 2016-10-31
08:03:01.000000000 +0100
+++ new/persistable-record-0.4.1.1/persistable-record.cabal 2017-02-19
08:43:07.000000000 +0100
@@ -1,5 +1,5 @@
name: persistable-record
-version: 0.4.1.0
+version: 0.4.1.1
synopsis: Binding between SQL database values and haskell records.
description: This package contiains types to represent table
constraints and
interfaces to bind between SQL database values and
Haskell records.
@@ -8,11 +8,11 @@
license-file: LICENSE
author: Kei Hibino
maintainer: [email protected]
-copyright: Copyright (c) 2013-2016 Kei Hibino
+copyright: Copyright (c) 2013-2017 Kei Hibino
category: Database
build-type: Simple
cabal-version: >=1.10
-tested-with: GHC == 8.0.1
+tested-with: GHC == 8.0.1, GHC == 8.0.2
, GHC == 7.10.1, GHC == 7.10.2, GHC == 7.10.3
, GHC == 7.8.1, GHC == 7.8.2, GHC == 7.8.3, GHC == 7.8.4
, GHC == 7.6.1, GHC == 7.6.2, GHC == 7.6.3
@@ -38,9 +38,18 @@
, names-th
hs-source-dirs: src
ghc-options: -Wall
-
default-language: Haskell2010
+test-suite nested
+ build-depends: base <5
+ , quickcheck-simple
+ , persistable-record
+
+ type: exitcode-stdio-1.0
+ main-is: nestedEq.hs
+ hs-source-dirs: test
+ ghc-options: -Wall
+ default-language: Haskell2010
source-repository head
type: git
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/persistable-record-0.4.1.0/test/nestedEq.hs
new/persistable-record-0.4.1.1/test/nestedEq.hs
--- old/persistable-record-0.4.1.0/test/nestedEq.hs 1970-01-01
01:00:00.000000000 +0100
+++ new/persistable-record-0.4.1.1/test/nestedEq.hs 2017-02-19
08:43:07.000000000 +0100
@@ -0,0 +1,67 @@
+{-# OPTIONS -fno-warn-orphans #-}
+{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-}
+
+import Control.Applicative ((<$>), (<*>))
+import Test.QuickCheck.Simple (defaultMain, eqTest)
+
+import Database.Record
+ (PersistableType (..),
+ FromSql (..), valueRecordFromSql, toRecord,
+ ToSql (..), valueRecordToSql)
+import Database.Record.Persistable (unsafePersistableSqlTypeFromNull)
+
+
+instance PersistableType String where
+ persistableType = unsafePersistableSqlTypeFromNull "<null>"
+
+
+instance FromSql String String where
+ recordFromSql = valueRecordFromSql id
+
+instance FromSql String Int where
+ recordFromSql = valueRecordFromSql read
+
+instance ToSql String String where
+ recordToSql = valueRecordToSql id
+
+instance ToSql String Int where
+ recordToSql = valueRecordToSql show
+
+
+data User =
+ User
+ { uid :: Int
+ , uname :: String
+ , note :: String
+ } deriving (Eq, Show)
+
+data Group =
+ Group
+ { gid :: Int
+ , gname :: String
+ } deriving (Eq, Show)
+
+data Membership =
+ Membership
+ { user :: User
+ , group :: Group
+ } deriving (Eq, Show)
+
+instance FromSql String User where
+ recordFromSql = User <$> recordFromSql <*> recordFromSql <*> recordFromSql
+
+instance FromSql String Group where
+ recordFromSql = Group <$> recordFromSql <*> recordFromSql
+
+instance FromSql String Membership where
+ recordFromSql = Membership <$> recordFromSql <*> recordFromSql
+
+main :: IO ()
+main =
+ defaultMain
+ [ eqTest
+ "nestedEq"
+ (Membership { user = User { uid = 1, uname = "Kei Hibino", note = "HRR
developer" }
+ , group = Group { gid = 1, gname = "Haskellers" }
+ } )
+ (toRecord ["1", "Kei Hibino", "HRR developer", "1", "Haskellers"]) ]