rr-quickcheck: update tests for GHC 7.4.

This commit is contained in:
Kei Hibino 2017-03-29 16:59:17 +09:00
parent 727a2c6663
commit dac7e2eb25
2 changed files with 10 additions and 2 deletions

View File

@ -16,6 +16,10 @@ build-type: Simple
-- extra-source-files: -- extra-source-files:
cabal-version: >=1.10 cabal-version: >=1.10
flag ghc74-generic
description: Enable for generic programming using old ghc. If true use ghc-prim.
default: False
library library
exposed-modules: exposed-modules:
Test.Relational.QuickCheck.Model Test.Relational.QuickCheck.Model
@ -32,6 +36,9 @@ library
, persistable-record , persistable-record
, relational-query , relational-query
, relational-query-HDBC , relational-query-HDBC
if flag(ghc74-generic)
build-depends: ghc-prim == 0.2.*
hs-source-dirs: src hs-source-dirs: src
ghc-options: -Wall ghc-options: -Wall
default-language: Haskell2010 default-language: Haskell2010

View File

@ -7,7 +7,8 @@ module Test.Relational.QuickCheck.Tests (
prop_join0, prop_join1, prop_join0, prop_join1,
) where ) where
import Test.QuickCheck (Property, ioProperty) import Test.QuickCheck (Property)
import Test.QuickCheck.Property (morallyDubiousIOProperty)
import Test.QuickCheck.Simple (Test, qcTest) import Test.QuickCheck.Simple (Test, qcTest)
import Control.Monad (unless) import Control.Monad (unless)
import Data.List (sort) import Data.List (sort)
@ -35,7 +36,7 @@ propQueryResult :: (Eq a, Show a, FromSql SqlValue a, IConnection conn)
-> [a] -> [a]
-> Property -> Property
propQueryResult connect initialize select expect = propQueryResult connect initialize select expect =
ioProperty . withConnectionIO' connect $ \conn -> do morallyDubiousIOProperty . withConnectionIO' connect $ \conn -> do
initialize conn initialize conn
qresult <- runQuery' conn select () qresult <- runQuery' conn select ()
let judge = qresult == expect let judge = qresult == expect