Skip to content

Commit

Permalink
Add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
parsonsmatt committed Jun 17, 2019
1 parent aa07462 commit ca44655
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
.cabal-sandbox/
cabal.sandbox.config
.hspec-failures
stack.yaml.lock
16 changes: 16 additions & 0 deletions test/Common/Test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ca44655

Please sign in to comment.