Whitespace.

This commit is contained in:
Felipe Lessa 2012-09-04 01:10:37 -03:00
parent 15121a7d27
commit 8a601551e4

View File

@ -49,6 +49,7 @@ main = do
run $ do run $ do
ret <- select $ return $ val (3 :: Int) ret <- select $ return $ val (3 :: Int)
liftIO $ ret `shouldBe` [ Single 3 ] liftIO $ ret `shouldBe` [ Single 3 ]
describe "select/from" $ do describe "select/from" $ do
it "works for a simple example" $ it "works for a simple example" $
run $ do run $ do
@ -57,6 +58,7 @@ main = do
from $ \person -> from $ \person ->
return person return person
liftIO $ ret `shouldBe` [ Entity p1k p1 ] liftIO $ ret `shouldBe` [ Entity p1k p1 ]
it "works for a simple self-join (one entity)" $ it "works for a simple self-join (one entity)" $
run $ do run $ do
p1k <- insert p1 p1k <- insert p1
@ -64,6 +66,7 @@ main = do
from $ \(person1, person2) -> from $ \(person1, person2) ->
return (person1, person2) return (person1, person2)
liftIO $ ret `shouldBe` [ (Entity p1k p1, Entity p1k p1) ] liftIO $ ret `shouldBe` [ (Entity p1k p1, Entity p1k p1) ]
it "works for a simple self-join (two entities)" $ it "works for a simple self-join (two entities)" $
run $ do run $ do
p1k <- insert p1 p1k <- insert p1
@ -75,6 +78,7 @@ main = do
, (Entity p1k p1, Entity p2k p2) , (Entity p1k p1, Entity p2k p2)
, (Entity p2k p2, Entity p1k p1) , (Entity p2k p2, Entity p1k p1)
, (Entity p2k p2, Entity p2k p2) ] , (Entity p2k p2, Entity p2k p2) ]
it "works for a simple projection" $ it "works for a simple projection" $
run $ do run $ do
p1k <- insert p1 p1k <- insert p1
@ -84,6 +88,7 @@ main = do
return (p ^. PersonId, p ^. PersonName) return (p ^. PersonId, p ^. PersonName)
liftIO $ ret `shouldBe` [ (Single p1k, Single (personName p1)) liftIO $ ret `shouldBe` [ (Single p1k, Single (personName p1))
, (Single p2k, Single (personName p2)) ] , (Single p2k, Single (personName p2)) ]
it "works for a simple projection with a simple self-join" $ it "works for a simple projection with a simple self-join" $
run $ do run $ do
p1k <- insert p1 p1k <- insert p1
@ -95,6 +100,7 @@ main = do
, (Single (personName p1), Single (personName p2)) , (Single (personName p1), Single (personName p2))
, (Single (personName p2), Single (personName p1)) , (Single (personName p2), Single (personName p1))
, (Single (personName p2), Single (personName p2)) ] , (Single (personName p2), Single (personName p2)) ]
describe "select/where_" $ do describe "select/where_" $ do
it "works for a simple example with (==.)" $ it "works for a simple example with (==.)" $
run $ do run $ do
@ -106,6 +112,7 @@ main = do
where_ (p ^. PersonName ==. val "John") where_ (p ^. PersonName ==. val "John")
return p return p
liftIO $ ret `shouldBe` [ Entity p1k p1 ] liftIO $ ret `shouldBe` [ Entity p1k p1 ]
it "works for a simple example with (==.) and (||.)" $ it "works for a simple example with (==.) and (||.)" $
run $ do run $ do
p1k <- insert p1 p1k <- insert p1
@ -116,6 +123,7 @@ main = do
where_ (p ^. PersonName ==. val "John" ||. p ^. PersonName ==. val "Rachel") where_ (p ^. PersonName ==. val "John" ||. p ^. PersonName ==. val "Rachel")
return p return p
liftIO $ ret `shouldBe` [ Entity p1k p1, Entity p2k p2 ] liftIO $ ret `shouldBe` [ Entity p1k p1, Entity p2k p2 ]
it "works for a simple example with (>.)" $ it "works for a simple example with (>.)" $
run $ do run $ do
p1k <- insert p1 p1k <- insert p1
@ -126,6 +134,7 @@ main = do
where_ (p ^. PersonAge >. val (Just 17)) where_ (p ^. PersonAge >. val (Just 17))
return p return p
liftIO $ ret `shouldBe` [ Entity p1k p1 ] liftIO $ ret `shouldBe` [ Entity p1k p1 ]
it "works for a simple example with (>.) and not_" $ it "works for a simple example with (>.) and not_" $
run $ do run $ do
_ <- insert p1 _ <- insert p1