From 75ead61274dd40fcffac6121cf2eca5ad6e384b5 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Wed, 23 Dec 2015 22:20:35 -0500 Subject: [PATCH] Move `getTotalRange` into the tests. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It’s kind of a lie. --- src/Split.hs | 3 --- test/SplitSpec.hs | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Split.hs b/src/Split.hs index 179809033..ee1a3d7de 100644 --- a/src/Split.hs +++ b/src/Split.hs @@ -28,9 +28,6 @@ makeSource list = Source (0, list) unSource :: Source a -> [a] unSource (Source (_, list)) = list -getTotalRange :: Source a -> Range -getTotalRange (Source (i, list)) = Range 0 $ i + length list - subsource :: Range -> Source a -> Source a subsource range (Source (i, list)) = Source (start range, sublist (offsetRange (negate i) range) list) diff --git a/test/SplitSpec.hs b/test/SplitSpec.hs index bd0d48c49..20e415ad7 100644 --- a/test/SplitSpec.hs +++ b/test/SplitSpec.hs @@ -105,6 +105,8 @@ spec = do isOnSingleLine (Source (_, a), _, _) = filter (/= '\n') a == a + getTotalRange (Source (i, list)) = Range 0 $ i + length list + combineIntoLeaves (leaves, start) char = (leaves ++ [ Free $ Annotated (Info (Range start $ start + 1) mempty, Info (Range start $ start + 1) mempty) (Leaf [ char ]) ], start + 1) leafWithRangesInSources sourceA sourceB rangeA rangeB = Free $ Annotated (Info rangeA mempty, Info rangeB mempty) (Leaf $ substring rangeA sourceA ++ substring rangeB sourceB)