1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 01:47:01 +03:00

Test that children assignment fails if the subrule fails.

This commit is contained in:
Rob Rix 2017-04-07 14:43:53 -04:00
parent b2da4ca89a
commit 71c5372d17

View File

@ -29,6 +29,9 @@ spec = do
it "matches if its subrule matches" $
() <$ runAssignment (children red) [ast Blue "b" [ast Red "a" []]] `shouldBe` Just ()
it "does not match if its subrule does not match" $
runAssignment (children red) [ast Blue "b" [ast Green "a" []]] `shouldBe` Nothing
ast :: Grammar -> ByteString -> [AST Grammar] -> AST Grammar
ast g s c = Rose (Node g s) c