1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 00:33:59 +03:00

Test that content assignment produces nodes’ content.

This commit is contained in:
Rob Rix 2017-04-07 14:57:00 -04:00
parent 0cc5c84706
commit c2a2b0b32b

View File

@ -24,6 +24,10 @@ spec = do
it "matches nodes with the same symbol" $
runAssignment red [ast Red "hello" []] `shouldBe` Just ([], Out "hello")
describe "content" $ do
it "produces the nodes content" $
snd <$> runAssignment content [ Rose (Node () "hi") [] ] `shouldBe` Just "hi"
describe "children" $ do
it "advances past the current node" $
fst <$> runAssignment (children (pure (Out ""))) [ast Red "a" []] `shouldBe` Just []