From ca44655abf69056e2480ee2279b513e311eae90c 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 6a8c43a40..e8694df9f 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ .cabal-sandbox/ cabal.sandbox.config .hspec-failures +stack.yaml.lock diff --git a/test/Common/Test.hs b/test/Common/Test.hs index a69f53443..e92a14441 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