M src/Data/Text/ParagraphLayout/Internal/Run.hs => src/Data/Text/ParagraphLayout/Internal/Run.hs +2 -1
@@ 115,7 115,8 @@ foldRun x (previousRun@(_, d1, s1) : tailRuns) =
s2 = charScript (nextChar x)
-- | Simplified detection of text direction for unidirectional text.
-mergeDirections :: Maybe Direction -> Maybe Direction -> Merged (Maybe Direction)
+mergeDirections :: Maybe Direction -> Maybe Direction ->
+ Merged (Maybe Direction)
mergeDirections Nothing Nothing = Merged Nothing
mergeDirections (Just d1) Nothing = Merged (Just d1)
mergeDirections Nothing (Just d2) = Merged (Just d2)
M test/Data/Text/ParagraphLayout/Internal/ZipperSpec.hs => test/Data/Text/ParagraphLayout/Internal/ZipperSpec.hs +5 -4
@@ 106,14 106,15 @@ spec = do
preMidPositions `forM_` \ n ->
describe ("split at " ++ (show n) ++ " and step") $ do
let z = Zipper.step $ Zipper.splitAt n sampleText
+ let n' = n + 1
it "is not at start" $
Zipper.atStart z `shouldBe` False
it "is not at end" $
Zipper.atEnd z `shouldBe` False
- it ("preceding text has length " ++ show (n + 1)) $
- Text.length (Zipper.preceding z) `shouldBe` (n + 1)
- it ("following text has length " ++ show (sampleLength - n - 1)) $
- Text.length (Zipper.following z) `shouldBe` (sampleLength - n - 1)
+ it ("preceding text has length " ++ show n') $
+ Text.length (Zipper.preceding z) `shouldBe` n'
+ it ("following text has length " ++ show (sampleLength - n')) $
+ Text.length (Zipper.following z) `shouldBe` (sampleLength - n')
it "recombines into original text" $
Zipper.recombine z `shouldBe` sampleText