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

Test the rows generated for single line empty unchanged indexed nodes.

This commit is contained in:
Rob Rix 2015-12-04 09:49:34 -05:00
parent 89afcac011
commit 35c573e00b

View File

@ -28,6 +28,9 @@ main = hspec $ do
describe "annotatedToRows" $ do
it "outputs one row for single-line unchanged leaves" $
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)
where
oneLineUnchangedIndexedSource = "[ a, b, c ]"
oneLineUnchangedIndexedRange = totalRange oneLineUnchangedIndexedSource