From 0cc5c84706eb2c9640864d457bddf4db32a49f88 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Fri, 7 Apr 2017 14:50:57 -0400 Subject: [PATCH] Move the rule assignment tests down. --- test/Data/Syntax/Assignment/Spec.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/Data/Syntax/Assignment/Spec.hs b/test/Data/Syntax/Assignment/Spec.hs index f4e7c320e..84448d688 100644 --- a/test/Data/Syntax/Assignment/Spec.hs +++ b/test/Data/Syntax/Assignment/Spec.hs @@ -6,10 +6,6 @@ import Test.Hspec spec :: Spec spec = do - describe "rule" $ do - it "matches nodes" $ - runAssignment red [ast Red "hello" []] `shouldBe` Just ([], Out "hello") - describe "Applicative" $ do it "matches in sequence" $ runAssignment ((,) <$> red <*> red) [ast Red "hello" [], ast Red "world" []] `shouldBe` Just ([], (Out "hello", Out "world")) @@ -24,6 +20,10 @@ spec = do it "matches one-or-more repetitions against one or more input nodes" $ runAssignment (some red) [ast Red "hello" []] `shouldBe` Just ([], [Out "hello"]) + describe "rule" $ do + it "matches nodes with the same symbol" $ + runAssignment red [ast Red "hello" []] `shouldBe` Just ([], Out "hello") + describe "children" $ do it "advances past the current node" $ fst <$> runAssignment (children (pure (Out ""))) [ast Red "a" []] `shouldBe` Just []