~jaro/balkon

7319cb0dea1d72651145d4f430b76aa637cb368e — Jaro 1 year, 7 months ago e2944b4
Fix style: white space in multi-line lists.
1 files changed, 63 insertions(+), 62 deletions(-)

M test/Data/Text/ParagraphLayout/Internal/BreakSpec.hs
M test/Data/Text/ParagraphLayout/Internal/BreakSpec.hs => test/Data/Text/ParagraphLayout/Internal/BreakSpec.hs +63 -62
@@ 29,99 29,99 @@ spec = do

            it "finds break at offset 0 in non-empty input" $
                b "en" (singleton 'a') `shouldBe`
                    [(0, BreakStatus.Soft)]
                    [ (0, BreakStatus.Soft)]

            it "finds hard break after newline" $
                b "en" (pack "hello\nworld") `shouldBe`
                    [(6, BreakStatus.Hard)
                    ,(0, BreakStatus.Soft)
                    [ (6, BreakStatus.Hard)
                    , (0, BreakStatus.Soft)
                    ]

            it "finds hard break after each of newlines" $
                b "en" (pack "hello\n\nworld") `shouldBe`
                    [(7, BreakStatus.Hard)
                    ,(6, BreakStatus.Hard)
                    ,(0, BreakStatus.Soft)
                    [ (7, BreakStatus.Hard)
                    , (6, BreakStatus.Hard)
                    , (0, BreakStatus.Soft)
                    ]

            it "finds soft breaks after spaces and tabs" $
                b "en" (pack "a few\twords") `shouldBe`
                    [(6, BreakStatus.Soft)
                    ,(2, BreakStatus.Soft)
                    ,(0, BreakStatus.Soft)
                    [ (6, BreakStatus.Soft)
                    , (2, BreakStatus.Soft)
                    , (0, BreakStatus.Soft)
                    ]

            it "finds soft breaks after each run of whitespace" $
                b "en" (pack " a  few\t more \n words\n") `shouldBe`
                    [(16, BreakStatus.Soft)
                    ,(15, BreakStatus.Hard)
                    ,(9, BreakStatus.Soft)
                    ,(4, BreakStatus.Soft)
                    ,(1, BreakStatus.Soft)
                    ,(0, BreakStatus.Soft)
                    [ (16, BreakStatus.Soft)
                    , (15, BreakStatus.Hard)
                    , (9, BreakStatus.Soft)
                    , (4, BreakStatus.Soft)
                    , (1, BreakStatus.Soft)
                    , (0, BreakStatus.Soft)
                    ]

            it "finds soft breaks after spaces and hyphens" $
                b "cs" (pack "následuje stanice Frýdek-Místek") `shouldBe`
                    [(27, BreakStatus.Soft)
                    ,(19, BreakStatus.Soft)
                    ,(11, BreakStatus.Soft)
                    ,(0, BreakStatus.Soft)
                    [ (27, BreakStatus.Soft)
                    , (19, BreakStatus.Soft)
                    , (11, BreakStatus.Soft)
                    , (0, BreakStatus.Soft)
                    ]

            it "finds soft breaks in Japanese kana" $
                b "ja" (pack "トイレはどこですか?") `shouldBe`
                    [(24, BreakStatus.Soft)
                    ,(21, BreakStatus.Soft)
                    ,(18, BreakStatus.Soft)
                    ,(15, BreakStatus.Soft)
                    ,(12, BreakStatus.Soft)
                    ,(9, BreakStatus.Soft)
                    ,(6, BreakStatus.Soft)
                    ,(3, BreakStatus.Soft)
                    ,(0, BreakStatus.Soft)
                    [ (24, BreakStatus.Soft)
                    , (21, BreakStatus.Soft)
                    , (18, BreakStatus.Soft)
                    , (15, BreakStatus.Soft)
                    , (12, BreakStatus.Soft)
                    , (9, BreakStatus.Soft)
                    , (6, BreakStatus.Soft)
                    , (3, BreakStatus.Soft)
                    , (0, BreakStatus.Soft)
                    ]

            let jaText = pack "五ヶ月‡コード"
            let jaBreaksStrict =
                    [(18, BreakStatus.Soft)
                    ,(12, BreakStatus.Soft)
                    ,(9, BreakStatus.Soft)
                    ,(6, BreakStatus.Soft)
                    ,(0, BreakStatus.Soft)
                    [ (18, BreakStatus.Soft)
                    , (12, BreakStatus.Soft)
                    , (9, BreakStatus.Soft)
                    , (6, BreakStatus.Soft)
                    , (0, BreakStatus.Soft)
                    ]
            let jaBreaksLoose =
                    [(18, BreakStatus.Soft)
                    ,(15, BreakStatus.Soft)
                    ,(12, BreakStatus.Soft)
                    ,(9, BreakStatus.Soft)
                    ,(6, BreakStatus.Soft)
                    ,(3, BreakStatus.Soft)
                    ,(0, BreakStatus.Soft)
                    [ (18, BreakStatus.Soft)
                    , (15, BreakStatus.Soft)
                    , (12, BreakStatus.Soft)
                    , (9, BreakStatus.Soft)
                    , (6, BreakStatus.Soft)
                    , (3, BreakStatus.Soft)
                    , (0, BreakStatus.Soft)
                    ]

            -- Observed behaviour.
            -- Not sure why Chinese rules are stricter for Japanese text.
            -- This behaviour may change with future versions of ICU.
            let expectedStrictLocales =
                    [""
                    ,"en"
                    ,"ja@lb=strict"
                    ,"zh"
                    ,"zh_Hans"
                    ,"zh_Hant"
                    ,"zxx"
                    ,"zxx-any-invalid-suffix"
                    [ ""
                    , "en"
                    , "ja@lb=strict"
                    , "zh"
                    , "zh_Hans"
                    , "zh_Hant"
                    , "zxx"
                    , "zxx-any-invalid-suffix"
                    ]
            let expectedLooseLocales =
                    ["@lb=loose"
                    ,"en@lb=loose"
                    ,"ja"
                    ,"ja_JP"
                    ,"ja-JP"
                    ,"ja-any-invalid-suffix"
                    ,"zh@lb=loose"
                    ,"zxx-any-invalid-suffix@lb=loose"
                    [ "@lb=loose"
                    , "en@lb=loose"
                    , "ja"
                    , "ja_JP"
                    , "ja-JP"
                    , "ja-any-invalid-suffix"
                    , "zh@lb=loose"
                    , "zxx-any-invalid-suffix@lb=loose"
                    ]

            expectedStrictLocales `forM_` \l ->


@@ 155,15 155,16 @@ spec = do

            it "finds break at offset 0 in non-empty input" $
                b "en" (singleton 'a') `shouldBe`
                    [(0, BreakStatus.Uncategorized)]
                    [ (0, BreakStatus.Uncategorized)
                    ]

            it "finds breaks after runs of letters and spaces" $
                b "en" (pack "a few   words") `shouldBe`
                    [(8, BreakStatus.Uncategorized)
                    ,(5, BreakStatus.Letter)
                    ,(2, BreakStatus.Uncategorized)
                    ,(1, BreakStatus.Letter)
                    ,(0, BreakStatus.Uncategorized)
                    [ (8, BreakStatus.Uncategorized)
                    , (5, BreakStatus.Letter)
                    , (2, BreakStatus.Uncategorized)
                    , (1, BreakStatus.Letter)
                    , (0, BreakStatus.Uncategorized)
                    ]

        -- Useful for breaking inside words for narrow output.