1
1
mirror of https://github.com/github/semantic.git synced 2024-12-29 01:42:43 +03:00

Test that assignment continues after children assignments.

This commit is contained in:
Rob Rix 2017-04-10 10:52:12 -04:00
parent c2482a0610
commit b1b1d2bd2f

View File

@ -53,6 +53,15 @@ spec = do
`shouldBe`
Just ([], "1")
it "continues after children" $ do
runAssignment
(many (rule 'A' *> children (rule 'B' *> content)
<|> rule 'C' *> content))
[ ast 'A' "" [ ast 'B' "B" [] ]
, ast 'C' "C" [] ]
`shouldBe`
Just ([], ["B", "C"])
ast :: grammar -> ByteString -> [AST grammar] -> AST grammar
ast g s c = Rose (Node g s) c