From d750f2318a6c2c1607a47fc5af58d33ba01bea94 Mon Sep 17 00:00:00 2001 From: Jaro Date: Thu, 9 Mar 2023 19:48:09 +0100 Subject: [PATCH] Ensure paragraph rect is unaffected by spans. --- test/Data/Text/ParagraphLayoutSpec.hs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/Data/Text/ParagraphLayoutSpec.hs b/test/Data/Text/ParagraphLayoutSpec.hs index 452ebe7..2ef5a24 100644 --- a/test/Data/Text/ParagraphLayoutSpec.hs +++ b/test/Data/Text/ParagraphLayoutSpec.hs @@ -94,6 +94,15 @@ spec = do (opts font) { paragraphMaxWidth = 20000 } result `shouldBeGolden` "spannedArabicFiller20em" + it "spans do not reposition filler text at 20em" $ \font -> do + let + withoutSpans = layoutPlain $ arabicFillerParagraph $ + (opts font) + { paragraphMaxWidth = 20000 } + withSpans = layoutPlain $ spannedArabicFillerParagraph $ + (opts font) + { paragraphMaxWidth = 20000 } + paragraphRect withoutSpans `shouldBe` paragraphRect withSpans describe "with Latin font" $ before loadUbuntuRegular $ do it "handles input with no spans" $ \font -> do let result = layoutPlain $ emptyParagraph $ opts font @@ -149,6 +158,15 @@ spec = do (opts font) { paragraphMaxWidth = 20000 } result `shouldBeGolden` "spannedLoremIpsum20em" + it "spans do not reposition lorem ipsum at 20em" $ \font -> do + let + withoutSpans = layoutPlain $ loremIpsumParagraph $ + (opts font) + { paragraphMaxWidth = 20000 } + withSpans = layoutPlain $ spannedLoremIpsumParagraph $ + (opts font) + { paragraphMaxWidth = 20000 } + paragraphRect withoutSpans `shouldBe` paragraphRect withSpans it "wraps mixed-script words correctly" $ \font -> do let result = layoutPlain $ mixedScriptWordsParagraph $ -- 2.30.2