mirror of
https://github.com/github/semantic.git
synced 2024-12-26 08:25:19 +03:00
Verify that sourceSpanToRange computes multi-line ranges.
This commit is contained in:
parent
8de562b88e
commit
50e5f8a411
@ -25,6 +25,11 @@ spec = parallel $ do
|
|||||||
ranges = actualLineRanges (totalRange source) source in
|
ranges = actualLineRanges (totalRange source) source in
|
||||||
sourceSpanToRange source <$> spans `shouldBe` ranges
|
sourceSpanToRange source <$> spans `shouldBe` ranges
|
||||||
|
|
||||||
|
prop "computes multi-line ranges" $
|
||||||
|
\ s -> let source = fromList s
|
||||||
|
ranges = actualLineRanges (totalRange source) source in
|
||||||
|
sourceSpanToRange source (totalSpan source) `shouldBe` totalRange source
|
||||||
|
|
||||||
describe "totalSpan" $ do
|
describe "totalSpan" $ do
|
||||||
prop "covers single lines" $
|
prop "covers single lines" $
|
||||||
\ n -> totalSpan (fromList (replicate n '*')) `shouldBe` SourceSpan "" (SourcePos 0 0) (SourcePos 0 (max 0 n))
|
\ n -> totalSpan (fromList (replicate n '*')) `shouldBe` SourceSpan "" (SourcePos 0 0) (SourcePos 0 (max 0 n))
|
||||||
|
Loading…
Reference in New Issue
Block a user