~jaro/balkon

07b55a3860ee3d685303213a96c9b7bad0fec7ad — Jaro 1 year, 6 months ago b9e2a94
Add expected run lengths to test data.
M test/Data/Text/ParagraphLayout/Internal/RunSpec.hs => test/Data/Text/ParagraphLayout/Internal/RunSpec.hs +2 -2
@@ 15,8 15,8 @@ import Data.Text.ParagraphLayout.TextData
defaultBox :: Direction -> ResolvedBox ()
defaultBox dir = ResolvedBox () 0 defaultBoxOptions dir

sampleSpan :: (Direction, String, Text) -> ResolvedSpan ()
sampleSpan (dir, lang, text) = ResolvedSpan
sampleSpan :: (Direction, String, Text, a) -> ResolvedSpan ()
sampleSpan (dir, lang, text, _) = ResolvedSpan
    { spanUserData = ()
    , spanIndex = 0
    , spanOffsetInParagraph = 0

M test/Data/Text/ParagraphLayout/TextData.hs => test/Data/Text/ParagraphLayout/TextData.hs +12 -1
@@ 14,13 14,15 @@ import Data.Text (Text, empty, pack)
import Data.Text.Glyphize (Direction (DirLTR, DirRTL))

type Language = String
type Sample = (Direction, Language, Text)
type DirectionRunLengths = [Int]
type Sample = (Direction, Language, Text, DirectionRunLengths)

arabicEmpty :: Sample
arabicEmpty =
    ( DirRTL
    , "ar"
    , empty
    , []
    )

englishEmpty :: Sample


@@ 28,6 30,7 @@ englishEmpty =
    ( DirLTR
    , "en"
    , empty
    , []
    )

englishWord :: Sample


@@ 35,6 38,7 @@ englishWord =
    ( DirRTL
    , "en"
    , pack "word"
    , [4]
    )

arabicHello :: Sample


@@ 42,6 46,7 @@ arabicHello =
    ( DirRTL
    , "ar"
    , pack "سلام"
    , [4]
    )

czechHello :: Sample


@@ 49,6 54,7 @@ czechHello =
    ( DirLTR
    , "cs"
    , pack "Ahoj, světe!"
    , [12]
    )

serbianMixedScript :: Sample


@@ 56,6 62,7 @@ serbianMixedScript =
    ( DirLTR
    , "sr"
    , pack "Vikipedija (Википедија)"
    , [23]
    )

-- | Source:


@@ 65,6 72,8 @@ arabicAroundEnglish =
    ( DirRTL
    , "ar"
    , pack "في XHTML 1.0 يتم تحقيق ذلك بإضافة العنصر المضمن bdo."
    -- TODO: Should be [3, 9, 36, 3, 1] according to Unicode BiDi.
    , [3, 10, 35, 4]
    )

-- | Source:


@@ 74,4 83,6 @@ englishAroundArabic =
    ( DirLTR
    , "en"
    , pack "The title is مفتاح معايير الويب in Arabic."
    -- TODO: Should be [13, 18, 11] according to Unicode BiDi.
    , [13, 19, 10]
    )