~jaro/balkon

4ff2ea2a04080eb644de0fba63237633c025ab0d — Jaro 1 year, 6 months ago ba3f061
Deduplicate emptyFont in RunSpec.
1 files changed, 9 insertions(+), 9 deletions(-)

M test/Data/Text/ParagraphLayout/Internal/RunSpec.hs
M test/Data/Text/ParagraphLayout/Internal/RunSpec.hs => test/Data/Text/ParagraphLayout/Internal/RunSpec.hs +9 -9
@@ 1,7 1,7 @@
module Data.Text.ParagraphLayout.Internal.RunSpec (spec) where

import Data.Text (Text, pack)
import Data.Text.Glyphize (Direction (..), Font, emptyFont)
import Data.Text.Glyphize (Direction (..), emptyFont)

import Test.Hspec
import Data.Text.ParagraphLayout.Internal.BoxOptions


@@ 15,14 15,14 @@ import Data.Text.ParagraphLayout.TextData
defaultBox :: Direction -> ResolvedBox ()
defaultBox dir = ResolvedBox () 0 defaultBoxOptions dir

sampleSpan :: (Direction, String, Text) -> Font -> ResolvedSpan ()
sampleSpan (dir, lang, text) font = ResolvedSpan
sampleSpan :: (Direction, String, Text) -> ResolvedSpan ()
sampleSpan (dir, lang, text) = ResolvedSpan
    { spanUserData = ()
    , spanIndex = 0
    , spanOffsetInParagraph = 0
    , spanText = text
    , spanTextOptions = (defaultTextOptions dir)
        { textFont = font
        { textFont = emptyFont
        , textLineHeight = Normal
        , textLanguage = lang
        }


@@ 35,11 35,11 @@ spec :: Spec
spec = do
    describe "spanToRuns" $ do
        it "handles span with no text" $ do
            let inputSpan = sampleSpan englishEmpty emptyFont
            let inputSpan = sampleSpan englishEmpty
            let runs = spanToRuns inputSpan
            runs `shouldBe` []
        it "handles Czech hello" $ do
            let inputSpan = sampleSpan czechHello emptyFont
            let inputSpan = sampleSpan czechHello
            let runs = spanToRuns inputSpan
            runs `shouldBe`
                [ Run


@@ 50,7 50,7 @@ spec = do
                    }
                ]
        it "handles Arabic hello" $ do
            let inputSpan = sampleSpan arabicHello emptyFont
            let inputSpan = sampleSpan arabicHello
            let runs = spanToRuns inputSpan
            runs `shouldBe`
                [ Run


@@ 61,7 61,7 @@ spec = do
                    }
                ]
        it "handles Serbian with mixed script" $ do
            let inputSpan = sampleSpan serbianMixedScript emptyFont
            let inputSpan = sampleSpan serbianMixedScript
            let runs = spanToRuns inputSpan
            runs `shouldBe`
                [ Run


@@ 79,7 79,7 @@ spec = do
                    }
                ]
        it "handles English text with Arabic inside" $ do
            let inputSpan = sampleSpan englishAroundArabic emptyFont
            let inputSpan = sampleSpan englishAroundArabic
            let runs = spanToRuns inputSpan
            runs `shouldBe`
                [ Run