mirror of
https://github.com/github/semantic.git
synced 2024-12-25 16:02:43 +03:00
Verify that sourceSpanToRange computes correct ranges within lines.
This commit is contained in:
parent
e6f4db8ee8
commit
1c335df1f0
@ -30,6 +30,10 @@ spec = parallel $ do
|
||||
ranges = actualLineRanges (totalRange source) source in
|
||||
sourceSpanToRange source (totalSpan source) `shouldBe` totalRange source
|
||||
|
||||
prop "computes sub-line ranges" $
|
||||
\ s -> let source = fromList ('*' : s <> "*") in
|
||||
sourceSpanToRange source (insetSpan (totalSpan source)) `shouldBe` insetRange (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