Fix many test suite warnings.
This commit is contained in:
parent
7bb68cc233
commit
3b3ef75373
@ -45,7 +45,6 @@ test-suite test
|
|||||||
, HUnit
|
, HUnit
|
||||||
, QuickCheck
|
, QuickCheck
|
||||||
, hspec == 1.3.*
|
, hspec == 1.3.*
|
||||||
, hspec-expectations == 0.3.*
|
|
||||||
, persistent-sqlite == 1.0.*
|
, persistent-sqlite == 1.0.*
|
||||||
, persistent-template == 1.0.*
|
, persistent-template == 1.0.*
|
||||||
, monad-control
|
, monad-control
|
||||||
|
|||||||
41
test/Test.hs
41
test/Test.hs
@ -13,7 +13,6 @@ import Database.Persist.TH
|
|||||||
import Language.Haskell.TH (Loc(..))
|
import Language.Haskell.TH (Loc(..))
|
||||||
import System.IO (stderr)
|
import System.IO (stderr)
|
||||||
import Test.Hspec
|
import Test.Hspec
|
||||||
import Test.Hspec.Expectations
|
|
||||||
|
|
||||||
import qualified Control.Monad.Trans.Reader as R
|
import qualified Control.Monad.Trans.Reader as R
|
||||||
import qualified Data.Conduit as C
|
import qualified Data.Conduit as C
|
||||||
@ -144,38 +143,20 @@ main = do
|
|||||||
in return () :: IO ()
|
in return () :: IO ()
|
||||||
|
|
||||||
it "throws an error for using on without joins" $
|
it "throws an error for using on without joins" $
|
||||||
run (do
|
run (select $
|
||||||
p1e <- insert' p1
|
from $ \(p, mb) -> do
|
||||||
p2e <- insert' p2
|
on (just (p ^. PersonId) ==. mb ?. BlogPostAuthorId)
|
||||||
p3e <- insert' p3
|
orderBy [ asc (p ^. PersonName), asc (mb ?. BlogPostTitle) ]
|
||||||
p4e <- insert' p4
|
return (p, mb)
|
||||||
b12e <- insert' $ BlogPost "b" (entityKey p1e)
|
|
||||||
b11e <- insert' $ BlogPost "a" (entityKey p1e)
|
|
||||||
b31e <- insert' $ BlogPost "c" (entityKey p3e)
|
|
||||||
ret <- select $
|
|
||||||
from $ \(p, mb) -> do
|
|
||||||
on (just (p ^. PersonId) ==. mb ?. BlogPostAuthorId)
|
|
||||||
orderBy [ asc (p ^. PersonName), asc (mb ?. BlogPostTitle) ]
|
|
||||||
return (p, mb)
|
|
||||||
return ()
|
|
||||||
) `shouldThrow` (\(OnClauseWithoutMatchingJoinException _) -> True)
|
) `shouldThrow` (\(OnClauseWithoutMatchingJoinException _) -> True)
|
||||||
|
|
||||||
it "throws an error for using too many ons" $
|
it "throws an error for using too many ons" $
|
||||||
run (do
|
run (select $
|
||||||
p1e <- insert' p1
|
from $ \(p `FullOuterJoin` mb) -> do
|
||||||
p2e <- insert' p2
|
on (just (p ^. PersonId) ==. mb ?. BlogPostAuthorId)
|
||||||
p3e <- insert' p3
|
on (just (p ^. PersonId) ==. mb ?. BlogPostAuthorId)
|
||||||
p4e <- insert' p4
|
orderBy [ asc (p ^. PersonName), asc (mb ?. BlogPostTitle) ]
|
||||||
b12e <- insert' $ BlogPost "b" (entityKey p1e)
|
return (p, mb)
|
||||||
b11e <- insert' $ BlogPost "a" (entityKey p1e)
|
|
||||||
b31e <- insert' $ BlogPost "c" (entityKey p3e)
|
|
||||||
ret <- select $
|
|
||||||
from $ \(p `FullOuterJoin` mb) -> do
|
|
||||||
on (just (p ^. PersonId) ==. mb ?. BlogPostAuthorId)
|
|
||||||
on (just (p ^. PersonId) ==. mb ?. BlogPostAuthorId)
|
|
||||||
orderBy [ asc (p ^. PersonName), asc (mb ?. BlogPostTitle) ]
|
|
||||||
return (p, mb)
|
|
||||||
return ()
|
|
||||||
) `shouldThrow` (\(OnClauseWithoutMatchingJoinException _) -> True)
|
) `shouldThrow` (\(OnClauseWithoutMatchingJoinException _) -> True)
|
||||||
|
|
||||||
describe "select/where_" $ do
|
describe "select/where_" $ do
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user