From 4ff2ea2a04080eb644de0fba63237633c025ab0d Mon Sep 17 00:00:00 2001 From: Jaro Date: Sun, 21 May 2023 12:39:56 +0200 Subject: [PATCH] Deduplicate emptyFont in RunSpec. --- .../Text/ParagraphLayout/Internal/RunSpec.hs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/Data/Text/ParagraphLayout/Internal/RunSpec.hs b/test/Data/Text/ParagraphLayout/Internal/RunSpec.hs index fb66bc4..dbb0ba0 100644 --- a/test/Data/Text/ParagraphLayout/Internal/RunSpec.hs +++ b/test/Data/Text/ParagraphLayout/Internal/RunSpec.hs @@ -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 -- 2.30.2