mirror of
https://github.com/github/semantic.git
synced 2024-12-25 07:55:12 +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
|
||||
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
|
||||
prop "covers single lines" $
|
||||
\ n -> totalSpan (fromList (replicate n '*')) `shouldBe` SourceSpan "" (SourcePos 0 0) (SourcePos 0 (max 0 n))
|
||||
|
Loading…
Reference in New Issue
Block a user