1
1
mirror of https://github.com/github/semantic.git synced 2024-12-29 09:55:52 +03:00

Test that alternations of repetitions succeed.

This commit is contained in:
Rob Rix 2017-07-26 12:02:18 -04:00
parent 3cbedc59a2
commit 898e119af9

View File

@ -46,6 +46,11 @@ spec = do
`shouldBe`
Right (Out "(blue)")
it "alternates repetitions" $
fst <$> runAssignment headF "blue blue" (many green <|> many blue) (makeState [node Blue 0 4 [], node Blue 5 9 []])
`shouldBe`
Right [Out "blue", Out "blue"]
describe "symbol" $ do
it "matches nodes with the same symbol" $
fst <$> runAssignment headF "hello" red (makeState [node Red 0 5 []]) `shouldBe` Right (Out "hello")