diff options
author | Matthias Clasen <mclasen@redhat.com> | 2014-08-30 20:20:00 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2014-08-30 20:20:00 -0400 |
commit | 0068b78276c4ac7df95d97fa270a5e8ca4b58348 (patch) | |
tree | 17ea02a2981883c9b230b3022e3fbc32a55bcd81 /tests/layouts | |
parent | 92e7b73e27f54db86d58dcb5b4ddaafb32101980 (diff) | |
download | pango-0068b78276c4ac7df95d97fa270a5e8ca4b58348.tar.gz |
Add tests for PangoLayout
This tests works similar to the markup parser tests -
we populate a layout with known data, and then compare
a dump of its properties with expected output.
Diffstat (limited to 'tests/layouts')
-rw-r--r-- | tests/layouts/valid-1.expected | 35 | ||||
-rw-r--r-- | tests/layouts/valid-1.markup | 2 | ||||
-rw-r--r-- | tests/layouts/valid-2.expected | 34 | ||||
-rw-r--r-- | tests/layouts/valid-2.markup | 2 |
4 files changed, 73 insertions, 0 deletions
diff --git a/tests/layouts/valid-1.expected b/tests/layouts/valid-1.expected new file mode 100644 index 00000000..5cf99a08 --- /dev/null +++ b/tests/layouts/valid-1.expected @@ -0,0 +1,35 @@ +This is a test of the automatic emergency brake! + +--- + +wrapped: 0 +ellipsized: 1 +lines: 2 +width: 225280 + +--- + +range 0 22 +range 22 41 +[22 41] foreground #00000000ffff +[22 41] underline 1 +range 41 2147483647 + +--- + +i=1, index=0, paragraph-start=1, dir=ltr 'This is a test of the automatic emergency brake! +' +i=2, index=49, paragraph-start=1, dir=ltr '' + +--- + +i=1, index=0, chars=22, level=0, gravity=south, flags=0, font=Cantarell 11, script=latin, language=c, 'This is a test of the ' +i=2, index=22, chars=11, level=0, gravity=south, flags=0, font=Cantarell 11, script=latin, language=c, 'automatic e' + [22 41] foreground #00000000ffff + [22 41] underline 1 +i=3, index=33, chars=15, level=0, gravity=south, flags=0, font=Cantarell 11, script=common, language=c, 'mergency brake!' + [0 2147483647] fallback 0 + [22 41] foreground #00000000ffff + [22 41] underline 1 +i=4, index=48, no run, line end +i=5, index=49, no run, line end diff --git a/tests/layouts/valid-1.markup b/tests/layouts/valid-1.markup new file mode 100644 index 00000000..780e6831 --- /dev/null +++ b/tests/layouts/valid-1.markup @@ -0,0 +1,2 @@ +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-2.expected b/tests/layouts/valid-2.expected new file mode 100644 index 00000000..c98bfd59 --- /dev/null +++ b/tests/layouts/valid-2.expected @@ -0,0 +1,34 @@ +test the blue drink after dinner + +--- + +wrapped: 0 +ellipsized: 0 +lines: 2 + +--- + +range 0 9 +range 9 13 +[9 13] style 2 +range 13 20 +range 20 25 +[20 25] underline 1 +range 25 2147483647 + +--- + +i=1, index=0, paragraph-start=1, dir=ltr 'test the blue drink after dinner +' +i=2, index=33, paragraph-start=1, dir=ltr '' + +--- + +i=1, index=0, chars=9, level=0, gravity=south, flags=0, font=Cantarell 11, script=latin, language=c, 'test the ' +i=2, index=9, chars=4, level=0, gravity=south, flags=0, font=Cantarell Oblique 11, script=latin, language=c, 'blue' +i=3, index=13, chars=7, level=0, gravity=south, flags=0, font=Cantarell 11, script=latin, language=c, ' drink ' +i=4, index=20, chars=5, level=0, gravity=south, flags=0, font=Cantarell 11, script=latin, language=c, 'after' + [20 25] underline 1 +i=5, index=25, chars=7, level=0, gravity=south, flags=0, font=Cantarell 11, script=latin, language=c, ' dinner' +i=6, index=32, no run, line end +i=7, index=33, no run, line end diff --git a/tests/layouts/valid-2.markup b/tests/layouts/valid-2.markup new file mode 100644 index 00000000..677f26f8 --- /dev/null +++ b/tests/layouts/valid-2.markup @@ -0,0 +1,2 @@ + +test the <i>blue</i> drink <u>after</u> dinner |