Hello community,
here is the log from the commit of package ghc-postgresql-binary for
openSUSE:Factory checked in at 2017-03-12 20:04:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-postgresql-binary (Old)
and /work/SRC/openSUSE:Factory/.ghc-postgresql-binary.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-postgresql-binary"
Sun Mar 12 20:04:16 2017 rev:2 rq:477838 version:0.9.3
Changes:
--------
---
/work/SRC/openSUSE:Factory/ghc-postgresql-binary/ghc-postgresql-binary.changes
2017-03-01 23:43:15.876427898 +0100
+++
/work/SRC/openSUSE:Factory/.ghc-postgresql-binary.new/ghc-postgresql-binary.changes
2017-03-12 20:04:16.775383235 +0100
@@ -1,0 +2,20 @@
+Mon Feb 20 08:42:15 UTC 2017 - [email protected]
+
+- Update to version 0.9.3 with cabal2obs.
+
+-------------------------------------------------------------------
+Sun Feb 5 19:32:32 UTC 2017 - [email protected]
+
+- Update to version 0.9.2 with cabal2obs.
+
+-------------------------------------------------------------------
+Tue Oct 11 08:49:45 UTC 2016 - [email protected]
+
+- Update to version 0.9.1.1 with cabal2obs.
+
+-------------------------------------------------------------------
+Wed Aug 17 18:28:09 UTC 2016 - [email protected]
+
+- Update to version 0.9.1 revision 0 with cabal2obs.
+
+-------------------------------------------------------------------
Old:
----
postgresql-binary-0.9.0.1.tar.gz
New:
----
postgresql-binary-0.9.3.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-postgresql-binary.spec ++++++
--- /var/tmp/diff_new_pack.lWLTpq/_old 2017-03-12 20:04:17.355301175 +0100
+++ /var/tmp/diff_new_pack.lWLTpq/_new 2017-03-12 20:04:17.359300609 +0100
@@ -1,7 +1,7 @@
#
# spec file for package ghc-postgresql-binary
#
-# 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
@@ -19,15 +19,14 @@
%global pkg_name postgresql-binary
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.9.0.1
+Version: 0.9.3
Release: 0
Summary: Encoders and decoders for the PostgreSQL's binary format
License: MIT
-Group: System/Libraries
+Group: Development/Languages/Other
Url: https://hackage.haskell.org/package/%{pkg_name}
Source0:
https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
BuildRequires: ghc-Cabal-devel
-# Begin cabal-rpm deps:
BuildRequires: ghc-aeson-devel
BuildRequires: ghc-base-prelude-devel
BuildRequires: ghc-binary-parser-devel
@@ -48,17 +47,15 @@
BuildRequires: ghc-conversion-bytestring-devel
BuildRequires: ghc-conversion-devel
BuildRequires: ghc-conversion-text-devel
-BuildRequires: ghc-either-devel
BuildRequires: ghc-json-ast-devel
BuildRequires: ghc-postgresql-libpq-devel
BuildRequires: ghc-quickcheck-instances-devel
-BuildRequires: ghc-rebase-devel
+BuildRequires: ghc-rerebase-devel
BuildRequires: ghc-tasty-devel
BuildRequires: ghc-tasty-hunit-devel
BuildRequires: ghc-tasty-quickcheck-devel
BuildRequires: ghc-tasty-smallcheck-devel
%endif
-# End cabal-rpm deps
%description
An API for dealing with PostgreSQL's binary data format.
@@ -67,7 +64,7 @@
<http://hackage.haskell.org/package/hasql "hasql"> is based on this library.
It supports all Postgres versions starting from 8.3 and is tested against 8.3,
-9.3 and 9.4 with the 'integer_datetimes' setting off and on.
+9.3 and 9.5 with the 'integer_datetimes' setting off and on.
%package devel
Summary: Haskell %{pkg_name} library development files
@@ -84,20 +81,14 @@
%prep
%setup -q -n %{pkg_name}-%{version}
-
%build
%ghc_lib_build
-
%install
%ghc_lib_install
-
%check
-%if %{with tests}
-%{cabal} test
-%endif
-
+%cabal_test
%post devel
%ghc_pkg_recache
++++++ postgresql-binary-0.9.0.1.tar.gz -> postgresql-binary-0.9.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/postgresql-binary-0.9.0.1/decoding/Main.hs
new/postgresql-binary-0.9.3/decoding/Main.hs
--- old/postgresql-binary-0.9.0.1/decoding/Main.hs 2016-05-29
01:29:32.000000000 +0200
+++ new/postgresql-binary-0.9.3/decoding/Main.hs 2017-02-13
16:15:39.000000000 +0100
@@ -1,14 +1,8 @@
module Main where
-import BasePrelude
-import MTLPrelude
-import Control.DeepSeq
+import Prelude
import Criterion
import Criterion.Main
-import Data.Text (Text)
-import Data.ByteString (ByteString)
-import Data.Scientific (Scientific)
-import Data.Time
import qualified PostgreSQL.Binary.Encoder as E
import qualified PostgreSQL.Binary.Decoder as D
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/postgresql-binary-0.9.0.1/encoding/Main.hs
new/postgresql-binary-0.9.3/encoding/Main.hs
--- old/postgresql-binary-0.9.0.1/encoding/Main.hs 2016-05-29
01:29:32.000000000 +0200
+++ new/postgresql-binary-0.9.3/encoding/Main.hs 2017-02-13
16:15:39.000000000 +0100
@@ -1,14 +1,8 @@
module Main where
-import BasePrelude
-import MTLPrelude
-import Control.DeepSeq
+import Prelude
import Criterion
import Criterion.Main
-import Data.Text (Text)
-import Data.ByteString (ByteString)
-import Data.Scientific (Scientific)
-import Data.Time
import qualified PostgreSQL.Binary.Encoder as E
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/postgresql-binary-0.9.0.1/library/PostgreSQL/Binary/Data.hs
new/postgresql-binary-0.9.3/library/PostgreSQL/Binary/Data.hs
--- old/postgresql-binary-0.9.0.1/library/PostgreSQL/Binary/Data.hs
2016-05-29 01:29:32.000000000 +0200
+++ new/postgresql-binary-0.9.3/library/PostgreSQL/Binary/Data.hs
2017-02-13 16:15:39.000000000 +0100
@@ -56,3 +56,45 @@
--
type Numeric =
(Int16, Word16, Vector Int16)
+
+-- |
+-- Representation of the PostgreSQL Network Address Type @inet@.
+--
+-- The Inet type holds an IPv4 or IPv6 host address, and optionally its subnet.
+-- The subnet is represented by the number of network address bits present in
the host address (the "netmask").
+-- If the subnet portion is missing, the netmask is 32 for IPv4 and 128 for
IPv6.
+data Inet
+ = InetIPv4 IPv4
+ | InetIPv4Subnet IPv4 Netmask
+ | InetIPv6 IPv6
+ | InetIPv6Subnet IPv6 Netmask
+ deriving (Eq, Show)
+
+type IPv4 = (Word8, Word8, Word8, Word8)
+
+type IPv6 = (Word16, Word16, Word16, Word16, Word16, Word16, Word16, Word16)
+
+type Netmask = Word8
+
+maxNetmaskIPv4 :: Word8
+maxNetmaskIPv4 = 32
+
+maxNetmaskIPv6 :: Word8
+maxNetmaskIPv6 = 128
+
+-- | Address family AF_INET
+afInet :: Word8
+afInet = 2
+
+-- | Address family AF_INET6
+afInet6 :: Word8
+afInet6 = 3
+
+ipv4Size :: Int8
+ipv4Size = 4
+
+ipv6Size :: Int8
+ipv6Size = 16
+
+isCidr :: Word8
+isCidr = 0
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/postgresql-binary-0.9.0.1/library/PostgreSQL/Binary/Decoder.hs
new/postgresql-binary-0.9.3/library/PostgreSQL/Binary/Decoder.hs
--- old/postgresql-binary-0.9.0.1/library/PostgreSQL/Binary/Decoder.hs
2016-05-29 01:29:32.000000000 +0200
+++ new/postgresql-binary-0.9.3/library/PostgreSQL/Binary/Decoder.hs
2017-02-13 16:15:39.000000000 +0100
@@ -17,6 +17,7 @@
fn,
numeric,
uuid,
+ inet,
json_ast,
json_bytes,
jsonb_ast,
@@ -87,9 +88,13 @@
{-# INLINABLE onContent #-}
onContent :: Decoder a -> Decoder ( Maybe a )
onContent decoder =
- intOfSize 4 >>= \case
+ size >>=
+ \case
(-1) -> pure Nothing
- n -> fmap Just (sized n decoder)
+ n -> fmap Just (sized (fromIntegral n) decoder)
+ where
+ size =
+ intOfSize 4 :: Decoder Int32
{-# INLINABLE content #-}
content :: Decoder (Maybe ByteString)
@@ -148,6 +153,47 @@
uuid =
UUID.fromWords <$> intOfSize 4 <*> intOfSize 4 <*> intOfSize 4 <*> intOfSize
4
+{-# INLINABLE ipv4 #-}
+ipv4 :: Decoder Data.IPv4
+ipv4 =
+ (,,,) <$> intOfSize 1 <*> intOfSize 1 <*> intOfSize 1 <*> intOfSize 1
+
+{-# INLINABLE ipv6 #-}
+ipv6 :: Decoder Data.IPv6
+ipv6 =
+ (,,,,,,,) <$> intOfSize 2 <*> intOfSize 2 <*> intOfSize 2 <*> intOfSize 2
<*> intOfSize 2 <*> intOfSize 2 <*> intOfSize 2 <*> intOfSize 2
+
+{-# INLINABLE inet #-}
+inet :: Decoder Data.Inet
+inet = do
+ af <- intOfSize 1
+ netmask <- intOfSize 1
+ isCidr <- intOfSize 1
+ ipSize <- intOfSize 1
+ if af == Data.afInet
+ then do
+ ip <- ipv4
+ return $ inetIPv4FromBytes af netmask isCidr ipSize ip
+ else do
+ ip <- ipv6
+ return $ inetIPv6FromBytes af netmask isCidr ipSize ip
+
+{-# INLINABLE inetIPv4FromBytes #-}
+inetIPv4FromBytes:: Word8 -> Word8 -> Word8 -> Int8 -> Data.IPv4 -> Data.Inet
+inetIPv4FromBytes _ netmask _ _ ip =
+ if netmask == Data.maxNetmaskIPv4 then
+ Data.InetIPv4 ip
+ else
+ Data.InetIPv4Subnet ip netmask
+
+{-# INLINABLE inetIPv6FromBytes #-}
+inetIPv6FromBytes:: Word8 -> Word8 -> Word8 -> Int8 -> Data.IPv6 -> Data.Inet
+inetIPv6FromBytes _ netmask _ _ ip =
+ if netmask == Data.maxNetmaskIPv6 then
+ Data.InetIPv6 ip
+ else
+ Data.InetIPv6Subnet ip netmask
+
{-# INLINABLE json_ast #-}
json_ast :: Decoder Aeson.Value
json_ast =
@@ -429,21 +475,30 @@
{-# INLINE composite #-}
composite :: CompositeDecoder a -> Decoder a
composite (CompositeDecoder decoder) =
- unitOfSize 4 *> decoder
+ numOfComponents *> decoder
+ where
+ numOfComponents =
+ unitOfSize 4
-- |
-- Lift a value 'Decoder' into 'CompositeDecoder'.
{-# INLINE compositeValue #-}
compositeValue :: Decoder a -> CompositeDecoder ( Maybe a )
-compositeValue =
- CompositeDecoder . onContent
+compositeValue valueDecoder =
+ CompositeDecoder (skipOid *> onContent valueDecoder)
+ where
+ skipOid =
+ unitOfSize 4
-- |
-- Lift a non-nullable value 'Decoder' into 'CompositeDecoder'.
{-# INLINE compositeNonNullValue #-}
compositeNonNullValue :: Decoder a -> CompositeDecoder a
-compositeNonNullValue =
- CompositeDecoder . join . fmap (maybe (failure "Unexpected NULL") return) .
onContent
+compositeNonNullValue valueDecoder =
+ CompositeDecoder (skipOid *> onContent valueDecoder >>= maybe (failure
"Unexpected NULL") return)
+ where
+ skipOid =
+ unitOfSize 4
-- * Array
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/postgresql-binary-0.9.0.1/library/PostgreSQL/Binary/Encoder.hs
new/postgresql-binary-0.9.3/library/PostgreSQL/Binary/Encoder.hs
--- old/postgresql-binary-0.9.0.1/library/PostgreSQL/Binary/Encoder.hs
2016-05-29 01:29:32.000000000 +0200
+++ new/postgresql-binary-0.9.3/library/PostgreSQL/Binary/Encoder.hs
2017-02-13 16:15:39.000000000 +0100
@@ -16,6 +16,7 @@
bool,
numeric,
uuid,
+ inet,
json_ast,
json_bytes,
jsonb_ast,
@@ -95,11 +96,29 @@
tuple4 e1 e2 e3 e4 =
\(v1, v2, v3, v4) -> e1 v1 <> e2 v2 <> e3 v3 <> e4 v4
+{-# INLINE tuple5 #-}
+tuple5 :: Encoder a -> Encoder b -> Encoder c -> Encoder d -> Encoder e ->
Encoder (a, b, c, d, e)
+tuple5 e1 e2 e3 e4 e5 (v1, v2, v3, v4, v5) = e1 v1 <> e2 v2 <> e3 v3 <> e4 v4
<> e5 v5
+
+{-# INLINE tuple8 #-}
+tuple8 :: Encoder a -> Encoder b -> Encoder c -> Encoder d -> Encoder e ->
Encoder f -> Encoder g -> Encoder h -> Encoder (a, b, c, d, e, f, g, h)
+tuple8 e1 e2 e3 e4 e5 e6 e7 e8 (v1, v2, v3, v4, v5, v6, v7, v8) = e1 v1 <> e2
v2 <> e3 v3 <> e4 v4 <> e5 v5 <> e6 v6 <> e7 v7 <> e8 v8
+
{-# INLINE premap #-}
premap :: (a -> b) -> Encoder b -> Encoder a
premap f e =
e . f
+{-# INLINE int_int8 #-}
+int_int8 :: Encoder Int8
+int_int8 =
+ Builder.int8
+
+{-# INLINE int_word8 #-}
+int_word8 :: Encoder Word8
+int_word8 =
+ Builder.word8
+
{-# INLINE int2_int16 #-}
int2_int16 :: Encoder Int16
int2_int16 =
@@ -222,6 +241,28 @@
uuid =
premap UUID.toWords (tuple4 int4_word32 int4_word32 int4_word32 int4_word32)
+{-# INLINABLE inetIPv4 #-}
+inetIPv4 :: Encoder (Word8, Word8, Word8, Int8, Data.IPv4)
+inetIPv4 =
+ tuple5 int_word8 int_word8 int_word8 int_int8 $ tuple4 int_word8 int_word8
int_word8 int_word8
+
+{-# INLINABLE inetIPv6 #-}
+inetIPv6 :: Encoder (Word8, Word8, Word8, Int8, Data.IPv6)
+inetIPv6 =
+ tuple5 int_word8 int_word8 int_word8 int_int8 $
+ tuple8 int2_word16 int2_word16 int2_word16 int2_word16 int2_word16
int2_word16 int2_word16 int2_word16
+
+{-# INLINABLE inet #-}
+inet :: Encoder Data.Inet
+inet i@(Data.InetIPv4 ipv4) =
+ premap (const (Data.afInet, Data.maxNetmaskIPv4, Data.isCidr, Data.ipv4Size,
ipv4)) inetIPv4 i
+inet i@(Data.InetIPv4Subnet ipv4 netmask) =
+ premap (const (Data.afInet, netmask, Data.isCidr, Data.ipv4Size, ipv4))
inetIPv4 i
+inet i@(Data.InetIPv6 ipv6) =
+ premap (const (Data.afInet6, Data.maxNetmaskIPv6, Data.isCidr,
Data.ipv6Size, ipv6)) inetIPv6 i
+inet i@(Data.InetIPv6Subnet ipv6 netmask) =
+ premap (const (Data.afInet6, netmask, Data.isCidr, Data.ipv6Size, ipv6))
inetIPv6 i
+
{-# INLINABLE json_ast #-}
json_ast :: Encoder Aeson.Value
#if MIN_VERSION_aeson(0,10,0)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/postgresql-binary-0.9.0.1/postgresql-binary.cabal
new/postgresql-binary-0.9.3/postgresql-binary.cabal
--- old/postgresql-binary-0.9.0.1/postgresql-binary.cabal 2016-05-29
01:29:32.000000000 +0200
+++ new/postgresql-binary-0.9.3/postgresql-binary.cabal 2017-02-13
16:15:39.000000000 +0100
@@ -1,7 +1,7 @@
name:
postgresql-binary
version:
- 0.9.0.1
+ 0.9.3
synopsis:
Encoders and decoders for the PostgreSQL's binary format
description:
@@ -12,7 +12,7 @@
is based on this library.
.
It supports all Postgres versions starting from 8.3
- and is tested against 8.3, 9.3 and 9.4
+ and is tested against 8.3, 9.3 and 9.5
with the @integer_datetimes@ setting off and on.
category:
PostgreSQL, Database, Codecs, Parsing
@@ -72,13 +72,13 @@
-- parsing:
binary-parser >= 0.5 && < 0.6,
-- data:
- aeson >= 0.9 && < 0.12,
+ aeson >= 0.9 && < 2,
uuid == 1.3.*,
time >= 1.4 && < 2,
scientific >= 0.2 && < 0.4,
bytestring >= 0.10.4 && < 0.11,
text >= 1 && < 2,
- vector >= 0.10 && < 0.12,
+ vector >= 0.10 && < 0.13,
-- errors:
loch-th == 0.2.*,
placeholders == 0.1.*,
@@ -119,27 +119,18 @@
tasty-smallcheck == 0.8.*,
tasty-hunit == 0.9.*,
quickcheck-instances >= 0.3.11 && < 0.4,
- QuickCheck >= 2.8.1 && < 2.9,
+ QuickCheck >= 2.8.1 && < 2.10,
-- data:
aeson,
- json-ast == 0.2.*,
- uuid == 1.3.*,
- time >= 1.4 && < 2,
- scientific >= 0.2 && < 0.4,
- bytestring >= 0.10.4 && < 0.11,
- text >= 1 && < 2,
- vector >= 0.10 && < 0.12,
- -- errors:
- loch-th == 0.2.*,
- placeholders == 0.1.*,
- -- general:
+ json-ast == 0.3.*,
conversion == 1.*,
conversion-bytestring == 1.*,
conversion-text == 1.*,
- either == 4.*,
- transformers,
- rebase >= 0.4 && < 2,
- base
+ -- debugging:
+ loch-th == 0.2.*,
+ placeholders == 0.1.*,
+ -- general:
+ rerebase >= 1.0.2 && < 2
benchmark encoding
@@ -162,15 +153,8 @@
postgresql-binary,
-- benchmarking:
criterion >= 1.0 && < 1.2,
- -- data:
- time,
- scientific,
- text,
- bytestring,
-- general:
- deepseq >= 1.3 && < 1.5,
- mtl-prelude < 3,
- base-prelude
+ rerebase < 2
benchmark decoding
@@ -193,12 +177,5 @@
postgresql-binary,
-- benchmarking:
criterion >= 1.0 && < 1.2,
- -- data:
- time,
- scientific,
- text,
- bytestring,
-- general:
- deepseq >= 1.3 && < 1.5,
- mtl-prelude < 3,
- base-prelude
+ rerebase < 2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/postgresql-binary-0.9.0.1/tasty/Main/Gens.hs
new/postgresql-binary-0.9.3/tasty/Main/Gens.hs
--- old/postgresql-binary-0.9.0.1/tasty/Main/Gens.hs 2016-05-29
01:29:32.000000000 +0200
+++ new/postgresql-binary-0.9.3/tasty/Main/Gens.hs 2017-02-13
16:15:39.000000000 +0100
@@ -3,17 +3,16 @@
import Main.Prelude hiding (assert, isRight, isLeft, choose)
import Test.QuickCheck hiding (vector)
import Test.QuickCheck.Instances
-import JSONAST (JSON)
+import JSONAST
import qualified Main.PTI as PTI
import qualified Data.Scientific as Scientific
import qualified Data.UUID as UUID
import qualified Data.Vector as Vector
-import qualified Rebase.Data.HashMap.Strict as HashMap
+import qualified Data.HashMap.Strict as HashMap
import qualified PostgreSQL.Binary.Data as Data
import qualified PostgreSQL.Binary.Encoder as Encoder
import qualified Data.Text as Text
import qualified Data.Aeson as Aeson
-import qualified JSONAST
-- * Generators
@@ -43,17 +42,17 @@
maxFreq =
6
null =
- pure JSONAST.Null
+ pure JSON_Null
bool =
- fmap JSONAST.Bool arbitrary
+ fmap JSON_Bool arbitrary
number =
- fmap JSONAST.Number arbitrary
+ fmap JSON_Number arbitrary
string =
- fmap JSONAST.String text
+ fmap JSON_String text
array =
- fmap JSONAST.Array (vector (byDepth (succ depth)))
+ fmap JSON_Array (vector (byDepth (succ depth)))
object =
- fmap JSONAST.Object (hashMap text (byDepth (succ depth)))
+ fmap JSON_Object (hashMap text (byDepth (succ depth)))
vector :: Gen a -> Gen (Vector a)
vector element =
@@ -121,6 +120,16 @@
uuid =
UUID.fromWords <$> arbitrary <*> arbitrary <*> arbitrary <*> arbitrary
+inet :: Gen Data.Inet
+inet = do
+ ipv6 <- choose (True, False)
+ subnetOn <- choose (True, False)
+ case (ipv6, subnetOn) of
+ (False, False) -> Data.InetIPv4 <$> ((,,,) <$> arbitrary <*> arbitrary <*>
arbitrary <*> arbitrary)
+ (False, True) -> Data.InetIPv4Subnet <$> ((,,,) <$> arbitrary <*>
arbitrary <*> arbitrary <*> arbitrary) <*> choose (0, Data.maxNetmaskIPv4 - 1)
+ (True, False) -> Data.InetIPv6 <$> ((,,,,,,,) <$> arbitrary <*> arbitrary
<*> arbitrary <*> arbitrary <*> arbitrary <*> arbitrary <*> arbitrary <*>
arbitrary)
+ (True, True) -> Data.InetIPv6Subnet <$> ((,,,,,,,) <$> arbitrary <*>
arbitrary <*> arbitrary <*> arbitrary <*> arbitrary <*> arbitrary <*> arbitrary
<*> arbitrary) <*> choose (0, Data.maxNetmaskIPv6 - 1)
+
arrayRep :: Gen (Word32, Data.Array)
arrayRep =
do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/postgresql-binary-0.9.0.1/tasty/Main/Prelude.hs
new/postgresql-binary-0.9.3/tasty/Main/Prelude.hs
--- old/postgresql-binary-0.9.0.1/tasty/Main/Prelude.hs 2016-05-29
01:29:32.000000000 +0200
+++ new/postgresql-binary-0.9.3/tasty/Main/Prelude.hs 2017-02-13
16:15:39.000000000 +0100
@@ -11,9 +11,9 @@
where
--- rebase
+-- rerebase
-------------------------
-import Rebase.Prelude as Exports hiding (assert, Data, fail)
+import Prelude as Exports hiding (assert, Data, fail, check)
-- conversion
-------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/postgresql-binary-0.9.0.1/tasty/Main.hs
new/postgresql-binary-0.9.3/tasty/Main.hs
--- old/postgresql-binary-0.9.0.1/tasty/Main.hs 2016-05-29 01:29:32.000000000
+0200
+++ new/postgresql-binary-0.9.3/tasty/Main.hs 2017-02-13 16:15:39.000000000
+0100
@@ -36,6 +36,24 @@
else []
other =
[
+ let
+ sql =
+ "select (1, 'a')"
+ decoder _ =
+ Decoder.composite ((,) <$> Decoder.compositeNonNullValue
Decoder.int <*> Decoder.compositeNonNullValue Decoder.char)
+ expected =
+ (1 :: Int64, 'a')
+ in select sql decoder expected
+ ,
+ let
+ sql =
+ "select (1, null)"
+ decoder _ =
+ Decoder.composite ((,) <$> Decoder.compositeNonNullValue
Decoder.int <*> Decoder.compositeValue Decoder.char)
+ expected =
+ (1 :: Int64, Nothing :: Maybe Char)
+ in select sql decoder expected
+ ,
select "SELECT '1 year 2 months 3 days 4 hours 5 minutes 6 seconds
332211 microseconds' :: interval"
(bool Decoder.interval_float Decoder.interval_int)
(picosecondsToDiffTime (10^6 * (332211 + 10^6 * (6 + 60 * (5 + 60
* (4 + 24 * (3 + 31 * (2 + 12))))))))
@@ -123,6 +141,8 @@
,
stdRoundtrip "uuid" Gens.uuid PTI.uuid Encoder.uuid Decoder.uuid
,
+ stdRoundtrip "inet" Gens.inet PTI.inet Encoder.inet Decoder.inet
+ ,
stdRoundtrip "int2_int16" Gens.auto PTI.int2 Encoder.int2_int16
Decoder.int
,
stdRoundtrip "int2_word16" Gens.auto PTI.int2 Encoder.int2_word16
Decoder.int