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:
parent
dfb5cff0dc
commit
b2da4ca89a
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user