mirror of
https://github.com/github/semantic.git
synced 2024-12-29 01:42:43 +03:00
Move the rule assignment tests down.
This commit is contained in:
parent
f082473b4f
commit
0cc5c84706
@ -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 []
|
||||
|
Loading…
Reference in New Issue
Block a user