1
1
mirror of https://github.com/github/semantic.git synced 2024-11-29 02:44:36 +03:00

Test that matches are performed in sequence.

This commit is contained in:
Rob Rix 2017-04-06 14:36:19 -04:00
parent fe55642e6b
commit 761992e1fe

View File

@ -14,3 +14,6 @@ spec = do
it "attempts multiple alternatives" $ do
stepAssignment (if' <|> comment) [Rose (Node Comment "hello") []] `shouldBe` Just ([], wrapU (Comment.Comment "hello") :: Program Syntax ())
it "matches in sequence" $ do
stepAssignment ((,) <$> comment <*> comment) [Rose (Node Comment "hello") [], Rose (Node Comment "world") []] `shouldBe` Just ([], (wrapU (Comment.Comment "hello"), wrapU (Comment.Comment "world")) :: (Program Syntax (), Program Syntax ()))