From b1b1d2bd2f90cba28f58f4cda6d290ded209c3dd Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Mon, 10 Apr 2017 10:52:12 -0400 Subject: [PATCH] Test that assignment continues after children assignments. --- test/Data/Syntax/Assignment/Spec.hs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/Data/Syntax/Assignment/Spec.hs b/test/Data/Syntax/Assignment/Spec.hs index 300453e7b..c8a7621e8 100644 --- a/test/Data/Syntax/Assignment/Spec.hs +++ b/test/Data/Syntax/Assignment/Spec.hs @@ -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