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