Fix test suite for new SqliteException

Sorry for the breakage @meteficha, and hope you don't mind that I'm
deploying this to Hackage.
This commit is contained in:
Michael Snoyman 2015-03-29 08:29:49 +03:00
parent abf91a1352
commit 69a4ec0c44
2 changed files with 8 additions and 1 deletions

View File

@ -1,5 +1,5 @@
name: esqueleto name: esqueleto
version: 2.1.2.1 version: 2.1.2.2
synopsis: Type-safe EDSL for SQL queries on persistent backends. synopsis: Type-safe EDSL for SQL queries on persistent backends.
homepage: https://github.com/prowdsponsor/esqueleto homepage: https://github.com/prowdsponsor/esqueleto
license: BSD3 license: BSD3

View File

@ -34,6 +34,9 @@ import Database.Persist.MySQL ( withMySQLConn
, defaultConnectInfo) , defaultConnectInfo)
#else #else
import Database.Persist.Sqlite (withSqliteConn) import Database.Persist.Sqlite (withSqliteConn)
#if MIN_VERSION_persistent_sqlite(2,1,3)
import Database.Sqlite (SqliteException)
#endif
#endif #endif
import Database.Persist.TH import Database.Persist.TH
import Test.Hspec import Test.Hspec
@ -604,7 +607,11 @@ main = do
run (select $ run (select $
from $ \p -> do from $ \p -> do
return (coalesce [p ^. PersonAge]) :: SqlQuery (SqlExpr (Value (Maybe Int))) return (coalesce [p ^. PersonAge]) :: SqlQuery (SqlExpr (Value (Maybe Int)))
#if MIN_VERSION_persistent_sqlite(2,1,3)
) `shouldThrow` (\(_ :: SqliteException) -> True)
#else
) `shouldThrow` (\(_ :: IOException) -> True) ) `shouldThrow` (\(_ :: IOException) -> True)
#endif
#endif #endif
describe "text functions" $ describe "text functions" $