From 451beb9a559bcfc0c02e13bacbb647511f00b9a3 Mon Sep 17 00:00:00 2001 From: Philipp Balzarek Date: Tue, 21 Apr 2015 20:04:18 +0200 Subject: [PATCH] add a test case for #97 --- test/Test.hs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/Test.hs b/test/Test.hs index 5c8d379..9d355b0 100644 --- a/test/Test.hs +++ b/test/Test.hs @@ -439,6 +439,19 @@ main = do retArt `shouldBe` article retTag `shouldBe` tag + it "respects the associativity of joins" $ + run $ do + insert' p1 + ps <- select . from $ + \((p :: SqlExpr (Entity Person)) + `LeftOuterJoin` + (( q :: SqlExpr (Entity Person)) + `InnerJoin` (r :: SqlExpr (Entity Person)))) -> do + on (val False) -- Inner join is empty + on (val True) + return p + liftIO $ (entityVal <$> ps) `shouldBe` [p1] + describe "select/where_" $ do it "works for a simple example with (==.)" $ run $ do