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