1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 00:33:59 +03:00

Test that children assignments match if their subrule matches.

This commit is contained in:
Rob Rix 2017-04-07 14:42:25 -04:00
parent dfb5cff0dc
commit b2da4ca89a

View File

@ -26,6 +26,9 @@ spec = do
it "advances past the current node" $
fst <$> runAssignment (children (pure (Out ""))) [ast Red "a" []] `shouldBe` Just []
it "matches if its subrule matches" $
() <$ runAssignment (children red) [ast Blue "b" [ast Red "a" []]] `shouldBe` Just ()
ast :: Grammar -> ByteString -> [AST Grammar] -> AST Grammar
ast g s c = Rose (Node g s) c