mirror of
https://github.com/github/semantic.git
synced 2024-11-29 02:44:36 +03:00
Test one-or-more repetition.
This commit is contained in:
parent
ad0fa60a3e
commit
38466c64e0
@ -21,5 +21,8 @@ spec = do
|
||||
it "matches repetitions" $
|
||||
stepAssignment (many comment) [ast Comment "colourless" [], ast Comment "green" [], ast Comment "ideas" [], ast Comment "sleep" [], ast Comment "furiously" []] `shouldBe` Just ([], [wrapU (Comment.Comment "colourless"), wrapU (Comment.Comment "green"), wrapU (Comment.Comment "ideas"), wrapU (Comment.Comment "sleep"), wrapU (Comment.Comment "furiously")] :: [Program Syntax ()])
|
||||
|
||||
it "matches one-or-more repetitions against one or more input nodes" $
|
||||
stepAssignment (some comment) [ast Comment "hello" []] `shouldBe` Just ([], [wrapU (Comment.Comment "hello")] :: [Program Syntax ()])
|
||||
|
||||
ast :: Grammar -> ByteString -> [AST Grammar] -> AST Grammar
|
||||
ast g s c = Rose (Node g s) c
|
||||
|
Loading…
Reference in New Issue
Block a user