diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-11-17 20:56:25 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-11-18 13:58:15 -0500 |
commit | 4d60ee85616d500c3384301330b8bfae619c7963 (patch) | |
tree | b0e200841afd8da783c8cd6965ee1f5867dd9cfd /tests/layouts | |
parent | 2aead7a8e8828de6afef96611661997a52ca6739 (diff) | |
download | pango-4d60ee85616d500c3384301330b8bfae619c7963.tar.gz |
Make test-layout use layout serialization
Now that we have this api, lets use it for
our tests.
Diffstat (limited to 'tests/layouts')
44 files changed, 343 insertions, 81 deletions
diff --git a/tests/layouts/valid-1.layout b/tests/layouts/valid-1.layout new file mode 100644 index 00000000..9289830b --- /dev/null +++ b/tests/layouts/valid-1.layout @@ -0,0 +1,20 @@ +{ + "text" : "This is a test of the automatic emergency brake!\n", + "attributes" : [ + { + "start" : 22, + "end" : 41, + "type" : "foreground", + "value" : "#00000000ffff" + }, + { + "start" : 22, + "end" : 41, + "type" : "underline", + "value" : "single" + } + ], + "font" : "Cantarell 11", + "ellipsize" : "end", + "width" : 225280 +} diff --git a/tests/layouts/valid-1.markup b/tests/layouts/valid-1.markup deleted file mode 100644 index 780e6831..00000000 --- a/tests/layouts/valid-1.markup +++ /dev/null @@ -1,2 +0,0 @@ -width=220,ellipsize=end -This is a test of the <span foreground="#0000ff" underline="single">automatic emergency</span> brake! diff --git a/tests/layouts/valid-10.layout b/tests/layouts/valid-10.layout new file mode 100644 index 00000000..0d36a38d --- /dev/null +++ b/tests/layouts/valid-10.layout @@ -0,0 +1,8 @@ +{ + "text" : "Hello שלום Γειά σας\n", + "attributes" : [], + "font" : "Cantarell 11", + "justify" : true, + "ellipsize" : "end", + "width" : 102400 +} diff --git a/tests/layouts/valid-10.markup b/tests/layouts/valid-10.markup deleted file mode 100644 index 15bf693d..00000000 --- a/tests/layouts/valid-10.markup +++ /dev/null @@ -1,2 +0,0 @@ -width=100,justify=true,ellipsize=end -Hello שלום Γειά σας diff --git a/tests/layouts/valid-11.layout b/tests/layouts/valid-11.layout new file mode 100644 index 00000000..a044cc53 --- /dev/null +++ b/tests/layouts/valid-11.layout @@ -0,0 +1,42 @@ +{ + "text" : "double low error\n", + "attributes" : [ + { + "end" : 6, + "type" : "underline", + "value" : "double" + }, + { + "end" : 6, + "type" : "overline", + "value" : "single" + }, + { + "start" : 7, + "end" : 10, + "type" : "underline", + "value" : "low" + }, + { + "start" : 7, + "end" : 10, + "type" : "strikethrough", + "value" : true + }, + { + "start" : 11, + "end" : 16, + "type" : "underline", + "value" : "error" + }, + { + "start" : 11, + "end" : 16, + "type" : "rise", + "value" : 1024 + } + ], + "font" : "Cantarell 11", + "wrap" : "char", + "width" : 225280 +} diff --git a/tests/layouts/valid-11.markup b/tests/layouts/valid-11.markup deleted file mode 100644 index fbf1abd2..00000000 --- a/tests/layouts/valid-11.markup +++ /dev/null @@ -1,2 +0,0 @@ -width=220,wrap=char -<span underline='double' overline='single'>double</span> <span underline='low' strikethrough='true'>low</span> <span underline='error' rise='1024'>error</span> diff --git a/tests/layouts/valid-12.layout b/tests/layouts/valid-12.layout new file mode 100644 index 00000000..1c9fa227 --- /dev/null +++ b/tests/layouts/valid-12.layout @@ -0,0 +1,15 @@ +{ + "text" : "a b c d
e f g h\n", + "attributes" : [], + "font" : "Cantarell 11", + "tabs" : { + "positions-in-pixels" : true, + "positions" : [ + 0, + 50, + 100, + 150, + 200 + ] + } +} diff --git a/tests/layouts/valid-12.markup b/tests/layouts/valid-12.markup deleted file mode 100644 index b7306cc6..00000000 --- a/tests/layouts/valid-12.markup +++ /dev/null @@ -1,2 +0,0 @@ -wrap=word,tabs=0 50 100 150 200 -a b c d
e f g h diff --git a/tests/layouts/valid-13.layout b/tests/layouts/valid-13.layout new file mode 100644 index 00000000..a9f10f86 --- /dev/null +++ b/tests/layouts/valid-13.layout @@ -0,0 +1,16 @@ +{ + "text" : "a b c d
e f g h\n", + "attributes" : [], + "font" : "Cantarell 11", + "tabs" : { + "positions-in-pixels" : true, + "positions" : [ + 0, + 50, + 100, + 150, + 200 + ] + }, + "single-paragraph" : true +} diff --git a/tests/layouts/valid-13.markup b/tests/layouts/valid-13.markup deleted file mode 100644 index be2345d1..00000000 --- a/tests/layouts/valid-13.markup +++ /dev/null @@ -1,2 +0,0 @@ -wrap=word,tabs=0 50 100 150 200,single_paragraph=true -a b c d
e f g h diff --git a/tests/layouts/valid-14.layout b/tests/layouts/valid-14.layout new file mode 100644 index 00000000..116cc94f --- /dev/null +++ b/tests/layouts/valid-14.layout @@ -0,0 +1,8 @@ +{ + "text" : "你好 Hello שלום Γειά σας\n", + "attributes" : [], + "font" : "Cantarell 11", + "ellipsize" : "start", + "width" : 161792, + "line-spacing" : 1.5 +} diff --git a/tests/layouts/valid-14.markup b/tests/layouts/valid-14.markup deleted file mode 100644 index 1d556d26..00000000 --- a/tests/layouts/valid-14.markup +++ /dev/null @@ -1,2 +0,0 @@ -line_spacing=1.5,width=158,ellipsize=start -你好 Hello שלום Γειά σας diff --git a/tests/layouts/valid-15.layout b/tests/layouts/valid-15.layout new file mode 100644 index 00000000..9f584ba6 --- /dev/null +++ b/tests/layouts/valid-15.layout @@ -0,0 +1,8 @@ +{ + "text" : "Lets see if this text is long enough to wrap due to height limitations. It might, or it might not.\n", + "attributes" : [], + "font" : "Cantarell 11", + "ellipsize" : "end", + "width" : 153600, + "height" : 40960 +} diff --git a/tests/layouts/valid-15.markup b/tests/layouts/valid-15.markup deleted file mode 100644 index e3081c81..00000000 --- a/tests/layouts/valid-15.markup +++ /dev/null @@ -1,2 +0,0 @@ -ellipsize=end,height=40,width=150 -Lets see if this text is long enough to wrap due to height limitations. It might, or it might not. diff --git a/tests/layouts/valid-16.layout b/tests/layouts/valid-16.layout new file mode 100644 index 00000000..e2a82d96 --- /dev/null +++ b/tests/layouts/valid-16.layout @@ -0,0 +1,9 @@ +{ + "text" : "Lets see if this text is long enough to wrap due to height limitations. It might, or it might not.\n", + "attributes" : [], + "font" : "Cantarell 11", + "wrap" : "word-char", + "ellipsize" : "end", + "width" : 153600, + "height" : -2 +} diff --git a/tests/layouts/valid-16.markup b/tests/layouts/valid-16.markup deleted file mode 100644 index 91a8ae37..00000000 --- a/tests/layouts/valid-16.markup +++ /dev/null @@ -1,2 +0,0 @@ -wrap=word-char,ellipsize=end,width=150,height=-2 -Lets see if this text is long enough to wrap due to height limitations. It might, or it might not. diff --git a/tests/layouts/valid-17.layout b/tests/layouts/valid-17.layout new file mode 100644 index 00000000..062cc241 --- /dev/null +++ b/tests/layouts/valid-17.layout @@ -0,0 +1,7 @@ +{ + "text" : "some|bla|bla|bla\n", + "attributes" : [], + "font" : "Cantarell 11", + "justify" : true, + "width" : 102400 +} diff --git a/tests/layouts/valid-17.markup b/tests/layouts/valid-17.markup deleted file mode 100644 index d804c20a..00000000 --- a/tests/layouts/valid-17.markup +++ /dev/null @@ -1,2 +0,0 @@ -justify=true,width=100 -some|bla|bla|bla diff --git a/tests/layouts/valid-18.layout b/tests/layouts/valid-18.layout new file mode 100644 index 00000000..85e9a7d1 --- /dev/null +++ b/tests/layouts/valid-18.layout @@ -0,0 +1,11 @@ +{ + "text" : "some line breaks
and miscellaneous ignorables\n", + "attributes" : [ + { + "end" : 57, + "type" : "show", + "value" : 7 + } + ], + "font" : "Cantarell 11" +} diff --git a/tests/layouts/valid-18.markup b/tests/layouts/valid-18.markup deleted file mode 100644 index ab5f5f35..00000000 --- a/tests/layouts/valid-18.markup +++ /dev/null @@ -1,2 +0,0 @@ - -<span show="spaces|line-breaks|ignorables">some line breaks
and miscellaneous ignorables</span> diff --git a/tests/layouts/valid-19.layout b/tests/layouts/valid-19.layout new file mode 100644 index 00000000..32ad1283 --- /dev/null +++ b/tests/layouts/valid-19.layout @@ -0,0 +1,5 @@ +{ + "text" : " a⃠ 😊︎ 😊️ 🇩🇪 ✊ ✋🏾 0 # 🏴 ©\n", + "attributes" : [], + "font" : "Cantarell 11" +} diff --git a/tests/layouts/valid-19.markup b/tests/layouts/valid-19.markup deleted file mode 100644 index e48c9f0e..00000000 --- a/tests/layouts/valid-19.markup +++ /dev/null @@ -1,2 +0,0 @@ -# various Emoji segmentation cases - a⃠ 😊︎ 😊️ 🇩🇪 ✊ ✋🏾 0 # 🏴 © diff --git a/tests/layouts/valid-2.layout b/tests/layouts/valid-2.layout new file mode 100644 index 00000000..303b2b67 --- /dev/null +++ b/tests/layouts/valid-2.layout @@ -0,0 +1,18 @@ +{ + "text" : "test the blue drink after dinner\n", + "attributes" : [ + { + "start" : 9, + "end" : 13, + "type" : "style", + "value" : "italic" + }, + { + "start" : 20, + "end" : 25, + "type" : "underline", + "value" : "single" + } + ], + "font" : "Cantarell 11" +} diff --git a/tests/layouts/valid-2.markup b/tests/layouts/valid-2.markup deleted file mode 100644 index 677f26f8..00000000 --- a/tests/layouts/valid-2.markup +++ /dev/null @@ -1,2 +0,0 @@ - -test the <i>blue</i> drink <u>after</u> dinner diff --git a/tests/layouts/valid-20.layout b/tests/layouts/valid-20.layout new file mode 100644 index 00000000..bde84b6f --- /dev/null +++ b/tests/layouts/valid-20.layout @@ -0,0 +1,22 @@ +{ + "text" : "abcdef\n", + "attributes" : [ + { + "end" : 3, + "type" : "gravity", + "value" : "east" + }, + { + "end" : 3, + "type" : "gravity-hint", + "value" : "strong" + }, + { + "start" : 3, + "end" : 6, + "type" : "gravity", + "value" : "south" + } + ], + "font" : "Cantarell 11" +} diff --git a/tests/layouts/valid-20.markup b/tests/layouts/valid-20.markup deleted file mode 100644 index fe6480d7..00000000 --- a/tests/layouts/valid-20.markup +++ /dev/null @@ -1,2 +0,0 @@ -# exercise gravity handling -<span gravity='east' gravity_hint='strong'>abc</span><span gravity='south'>def</span> diff --git a/tests/layouts/valid-21.expected b/tests/layouts/valid-21.expected deleted file mode 100644 index 5999056f..00000000 --- a/tests/layouts/valid-21.expected +++ /dev/null @@ -1,36 +0,0 @@ -有一位住在石室裏的詩人叫施氏,abc, 愛吃獅子,決心要吃十隻獅子。 - ---- parameters - -wrapped: 0 -ellipsized: 0 -lines: 2 - ---- attributes - -range 0 2147483647 - ---- directions - -0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - ---- cursor positions - -0(0) 3(0) 6(0) 9(0) 12(0) 15(0) 18(0) 21(0) 24(0) 27(0) 30(0) 33(0) 36(0) 39(0) 42(0) 45(0) 46(0) 47(0) 48(0) 49(0) 50(0) 53(0) 56(0) 59(0) 62(0) 65(0) 68(0) 71(0) 74(0) 77(0) 80(0) 83(0) 86(0) 89(0) 89(1) 93(0) - ---- lines - -i=1, index=0, paragraph-start=1, dir=ltr '有一位住在石室裏的詩人叫施氏,abc, 愛吃獅子,決心要吃十隻獅子。 -' -i=2, index=93, paragraph-start=1, dir=ltr '' - ---- runs - -i=1, index=0, chars=14, level=0, gravity=east, flags=1, font=OMITTED, script=han, language=xx, '有一位住在石室裏的詩人叫施氏' -i=2, index=42, chars=1, level=0, gravity=east, flags=1, font=OMITTED, script=han, language=xx, ',' -i=3, index=45, chars=5, level=0, gravity=south, flags=1, font=OMITTED, script=latin, language=en-us, 'abc, ' -i=4, index=50, chars=4, level=0, gravity=east, flags=1, font=OMITTED, script=han, language=xx, '愛吃獅子' -i=5, index=62, chars=1, level=0, gravity=east, flags=1, font=OMITTED, script=han, language=xx, ',' -i=6, index=65, chars=9, level=0, gravity=east, flags=1, font=OMITTED, script=han, language=xx, '決心要吃十隻獅子。' -i=7, index=92, no run, line end -i=8, index=93, no run, line end diff --git a/tests/layouts/valid-21.markup b/tests/layouts/valid-21.markup deleted file mode 100644 index 676a5e56..00000000 --- a/tests/layouts/valid-21.markup +++ /dev/null @@ -1,2 +0,0 @@ -gravity=east -有一位住在石室裏的詩人叫施氏,abc, 愛吃獅子,決心要吃十隻獅子。 diff --git a/tests/layouts/valid-22.layout b/tests/layouts/valid-22.layout new file mode 100644 index 00000000..be57d26a --- /dev/null +++ b/tests/layouts/valid-22.layout @@ -0,0 +1,84 @@ +{ + "text" : "e0 = ooo...\n", + "attributes" : [ + { + "start" : 1, + "end" : 2, + "type" : "font-desc", + "value" : "Italic" + }, + { + "start" : 1, + "end" : 2, + "type" : "font-scale", + "value" : "subscript" + }, + { + "start" : 1, + "end" : 2, + "type" : "baseline-shift", + "value" : "subscript" + }, + { + "start" : 6, + "end" : 11, + "type" : "font-scale", + "value" : "superscript" + }, + { + "start" : 6, + "end" : 11, + "type" : "baseline-shift", + "value" : "superscript" + }, + { + "start" : 7, + "end" : 11, + "type" : "font-scale", + "value" : "superscript" + }, + { + "start" : 7, + "end" : 11, + "type" : "baseline-shift", + "value" : "superscript" + }, + { + "start" : 8, + "end" : 11, + "type" : "font-scale", + "value" : "superscript" + }, + { + "start" : 8, + "end" : 11, + "type" : "baseline-shift", + "value" : "superscript" + }, + { + "start" : 9, + "end" : 11, + "type" : "font-scale", + "value" : "superscript" + }, + { + "start" : 9, + "end" : 11, + "type" : "baseline-shift", + "value" : "superscript" + }, + { + "start" : 10, + "end" : 11, + "type" : "font-scale", + "value" : "superscript" + }, + { + "start" : 10, + "end" : 11, + "type" : "baseline-shift", + "value" : "superscript" + } + ], + "font" : "Cantarell 11" +} diff --git a/tests/layouts/valid-22.markup b/tests/layouts/valid-22.markup deleted file mode 100644 index d761749a..00000000 --- a/tests/layouts/valid-22.markup +++ /dev/null @@ -1,2 +0,0 @@ - -e<span font_desc="italic"><sub>0</sub></span> = o<sup>o<sup>o<sup>.<sup>.<sup>.</sup></sup></sup></sup></sup> diff --git a/tests/layouts/valid-3.layout b/tests/layouts/valid-3.layout new file mode 100644 index 00000000..ef1b1917 --- /dev/null +++ b/tests/layouts/valid-3.layout @@ -0,0 +1,5 @@ +{ + "text" : "ABC😀️D\n", + "attributes" : [], + "font" : "Cantarell 11" +} diff --git a/tests/layouts/valid-3.markup b/tests/layouts/valid-3.markup deleted file mode 100644 index 4e394a42..00000000 --- a/tests/layouts/valid-3.markup +++ /dev/null @@ -1,2 +0,0 @@ - -ABC😀️D diff --git a/tests/layouts/valid-4.layout b/tests/layouts/valid-4.layout new file mode 100644 index 00000000..5504107d --- /dev/null +++ b/tests/layouts/valid-4.layout @@ -0,0 +1,6 @@ +{ + "text" : "This paragraph should actually have multiple lines, unlike all the other wannabe äöü paragraph tests in this ugh test-case. Grow some lines!\n", + "attributes" : [], + "font" : "Cantarell 11", + "width" : 198656 +} diff --git a/tests/layouts/valid-4.markup b/tests/layouts/valid-4.markup deleted file mode 100644 index d8890baf..00000000 --- a/tests/layouts/valid-4.markup +++ /dev/null @@ -1,2 +0,0 @@ -width=194 -This paragraph should actually have multiple lines, unlike all the other wannabe äöü paragraph tests in this ugh test-case. Grow some lines! diff --git a/tests/layouts/valid-5.layout b/tests/layouts/valid-5.layout new file mode 100644 index 00000000..e5e96b9a --- /dev/null +++ b/tests/layouts/valid-5.layout @@ -0,0 +1,13 @@ +{ + "text" : "A test with multiple paragraphs and with no-break attributes, which might trigger a crash.\nIf it doesn't the fix has worked.\n", + "attributes" : [ + { + "start" : 21, + "end" : 31, + "type" : "font-features", + "value" : "tnum=1" + } + ], + "font" : "Cantarell 11", + "width" : 194560 +} diff --git a/tests/layouts/valid-5.markup b/tests/layouts/valid-5.markup deleted file mode 100644 index 2b2023ad..00000000 --- a/tests/layouts/valid-5.markup +++ /dev/null @@ -1,3 +0,0 @@ -width=190 -A test with multiple <span font_features="tnum=1">paragraphs</span> and with no-break attributes, which might trigger a crash. -If it doesn't the fix has worked. diff --git a/tests/layouts/valid-6.layout b/tests/layouts/valid-6.layout new file mode 100644 index 00000000..4423d068 --- /dev/null +++ b/tests/layouts/valid-6.layout @@ -0,0 +1,5 @@ +{ + "text" : " 0️⃣ Keycap Digit Zero\n", + "attributes" : [], + "font" : "Cantarell 11" +} diff --git a/tests/layouts/valid-6.markup b/tests/layouts/valid-6.markup deleted file mode 100644 index 92c53e28..00000000 --- a/tests/layouts/valid-6.markup +++ /dev/null @@ -1,2 +0,0 @@ - - 0️⃣ Keycap Digit Zero diff --git a/tests/layouts/valid-7.layout b/tests/layouts/valid-7.layout new file mode 100644 index 00000000..b49484c6 --- /dev/null +++ b/tests/layouts/valid-7.layout @@ -0,0 +1,21 @@ +{ + "text" : "This is a test of the automatic emergency brake!\n", + "attributes" : [ + { + "start" : 22, + "end" : 41, + "type" : "foreground", + "value" : "#00000000ffff" + }, + { + "start" : 22, + "end" : 41, + "type" : "underline", + "value" : "single" + } + ], + "font" : "Cantarell 11", + "ellipsize" : "middle", + "width" : 204800, + "indent" : 51200 +} diff --git a/tests/layouts/valid-7.markup b/tests/layouts/valid-7.markup deleted file mode 100644 index d5f9821e..00000000 --- a/tests/layouts/valid-7.markup +++ /dev/null @@ -1,2 +0,0 @@ -width=200,indent=50,ellipsize=middle -This is a test of the <span foreground="#0000ff" underline="single">automatic emergency</span> brake! diff --git a/tests/layouts/valid-8.layout b/tests/layouts/valid-8.layout new file mode 100644 index 00000000..063ec370 --- /dev/null +++ b/tests/layouts/valid-8.layout @@ -0,0 +1,8 @@ +{ + "text" : "Hello שלום Γειά σας\n", + "attributes" : [], + "font" : "Cantarell 11", + "auto-dir" : false, + "alignment" : "center", + "spacing" : 51200 +} diff --git a/tests/layouts/valid-8.markup b/tests/layouts/valid-8.markup deleted file mode 100644 index 3272ea2b..00000000 --- a/tests/layouts/valid-8.markup +++ /dev/null @@ -1,2 +0,0 @@ -spacing=50,auto_dir=false,alignment=center -Hello שלום Γειά σας diff --git a/tests/layouts/valid-9.layout b/tests/layouts/valid-9.layout new file mode 100644 index 00000000..e3dfa57b --- /dev/null +++ b/tests/layouts/valid-9.layout @@ -0,0 +1,12 @@ +{ + "text" : "Hello שלום Γειά σας\n", + "attributes" : [ + { + "end" : 30, + "type" : "letter-spacing", + "value" : 8888 + } + ], + "font" : "Cantarell 11", + "width" : 102400 +} diff --git a/tests/layouts/valid-9.markup b/tests/layouts/valid-9.markup deleted file mode 100644 index ced8f8e5..00000000 --- a/tests/layouts/valid-9.markup +++ /dev/null @@ -1,2 +0,0 @@ -width=100 -<span letter_spacing="8888">Hello שלום Γειά σας</span> |