1
1
mirror of https://github.com/github/semantic.git synced 2024-12-25 07:55:12 +03:00

Expect text nodes.

This commit is contained in:
Rob Rix 2015-12-04 10:07:38 -05:00
parent 7648c65e52
commit 357a1aa16c

View File

@ -30,7 +30,7 @@ main = hspec $ do
annotatedToRows (unchanged "a" "leaf" (Leaf "")) "a" "a" `shouldBe` ([ Row [ Span (Just "leaf") "a" ] [ Span (Just "leaf") "a" ] ], Range 0 1, Range 0 1)
it "outputs one row for single-line empty unchanged indexed nodes" $
annotatedToRows (unchanged "[]" "branch" (Indexed [])) "[]" "[]" `shouldBe` ([ Row [ Ul (Just "branch") [] ] [ Ul (Just "branch") [] ] ], Range 0 2, Range 0 2)
annotatedToRows (unchanged "[]" "branch" (Indexed [])) "[]" "[]" `shouldBe` ([ Row [ Ul (Just "branch") [ Text "[]" ] ] [ Ul (Just "branch") [ Text "[]" ] ] ], Range 0 2, Range 0 2)
where
info source category = Info (totalRange source) (Range 0 0) (Set.fromList [ category ])
unchanged source category = Annotated (info source category, info source category)