From 75c3549c868e9e671f21eaebfef0eb4a5e990b1d Mon Sep 17 00:00:00 2001 From: ncaq Date: Fri, 16 Dec 2016 15:45:44 +0900 Subject: [PATCH] use persistent-sqlite >= 2.1.3 --- esqueleto.cabal | 2 +- test/Test.hs | 13 +++---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/esqueleto.cabal b/esqueleto.cabal index 89fd8c7..9120be2 100644 --- a/esqueleto.cabal +++ b/esqueleto.cabal @@ -94,7 +94,7 @@ test-suite test , HUnit , QuickCheck , hspec >= 1.8 - , persistent-sqlite >= 2.1 + , persistent-sqlite >= 2.1.3 , persistent-template >= 2.1 , monad-control , monad-logger >= 0.3 diff --git a/test/Test.hs b/test/Test.hs index 619e539..64fb0d0 100644 --- a/test/Test.hs +++ b/test/Test.hs @@ -40,12 +40,9 @@ import Database.Persist.MySQL ( withMySQLConn , connectUser , connectPassword , defaultConnectInfo) -#else +#endif import Database.Persist.Sqlite (withSqliteConn) -#if MIN_VERSION_persistent_sqlite(2,1,3) import Database.Sqlite (SqliteException) -#endif -#endif import Database.Persist.TH import Test.Hspec @@ -921,12 +918,8 @@ main = do it "throws an exception on SQLite with <2 arguments" $ run (select $ from $ \p -> do - return (coalesce [p ^. PersonAge]) :: SqlQuery (SqlExpr (Value (Maybe Int))) -#if MIN_VERSION_persistent_sqlite(2,1,3) - ) `shouldThrow` (\(_ :: SqliteException) -> True) -#else - ) `shouldThrow` (\(_ :: IOException) -> True) -#endif + return (coalesce [p ^. PersonAge]) :: SqlQuery (SqlExpr (Value (Maybe Int)))) + `shouldThrow` (\(_ :: SqliteException) -> True) #endif describe "text functions" $ do