From c2a2b0b32bf3da3d025c93ce885fa695bcd35e6c Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Fri, 7 Apr 2017 14:57:00 -0400 Subject: [PATCH] =?UTF-8?q?Test=20that=20content=20assignment=20produces?= =?UTF-8?q?=20nodes=E2=80=99=20content.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/Data/Syntax/Assignment/Spec.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/Data/Syntax/Assignment/Spec.hs b/test/Data/Syntax/Assignment/Spec.hs index 84448d688..818008d80 100644 --- a/test/Data/Syntax/Assignment/Spec.hs +++ b/test/Data/Syntax/Assignment/Spec.hs @@ -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 node’s 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 []