Add failing test

This commit is contained in:
parsonsmatt 2019-06-17 14:41:11 -06:00 committed by Chris Allen
parent 3db6361d2c
commit 9338cfdc5e
2 changed files with 17 additions and 0 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@ stack.yaml.lock
.cabal-sandbox/
cabal.sandbox.config
.hspec-failures
stack.yaml.lock

View File

@ -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