From 9338cfdc5e00f22edf6af2cb5100ee8ea9bc142e Mon Sep 17 00:00:00 2001 From: parsonsmatt Date: Mon, 17 Jun 2019 14:41:11 -0600 Subject: [PATCH] Add failing test --- .gitignore | 1 + test/Common/Test.hs | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/.gitignore b/.gitignore index 17bdc76..0d29435 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ stack.yaml.lock .cabal-sandbox/ cabal.sandbox.config .hspec-failures +stack.yaml.lock diff --git a/test/Common/Test.hs b/test/Common/Test.hs index ce88058..c905a9a 100644 --- a/test/Common/Test.hs +++ b/test/Common/Test.hs @@ -219,6 +219,22 @@ testSelect run = do ret <- select $ return nothing liftIO $ ret `shouldBe` [ Value (Nothing :: Maybe Int) ] + describe "sub_select" $ do + it "works inside of sum" $ do + run $ do + ret <- + select $ + pure $ + sum_ $ + sub_select $ + from $ \foo -> do + pure (foo ^. FooName) + nonSub <- + select $ + from $ \foo -> do + pure (sum_ (foo ^. FooName)) + + liftIO $ ret `shouldBe` (nonSub :: [Value (Maybe Int)]) testSelectSource :: Run -> Spec testSelectSource run = do