diff options
author | Matthias Clasen <mclasen@redhat.com> | 2014-08-28 01:19:29 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2014-08-28 01:21:57 -0400 |
commit | 5d319c5989d599e9e867df76795eb81472b4db7a (patch) | |
tree | faf441b11ea93bbb2a99ee8a40697feeedb2b311 /tests/markups | |
parent | 0c827ee95c4ff6564eefabb519d00bfcccd046fe (diff) | |
download | pango-5d319c5989d599e9e867df76795eb81472b4db7a.tar.gz |
Add tests for pango markup
This test is modeled after the GMarkup parser tests in GLib.
Test file with a name ending in .markup can be dumped in
tests/markups/, and tests/markup-parse can be used to generate
the expected output files which should be in the same location
and with the extension .markup replaced by .expected.
The test is also used as an installed test.
Diffstat (limited to 'tests/markups')
-rw-r--r-- | tests/markups/fail-1.expected | 1 | ||||
-rw-r--r-- | tests/markups/fail-1.markup | 1 | ||||
-rw-r--r-- | tests/markups/valid-1.expected | 12 | ||||
-rw-r--r-- | tests/markups/valid-1.markup | 1 | ||||
-rw-r--r-- | tests/markups/valid-2.expected | 12 | ||||
-rw-r--r-- | tests/markups/valid-2.markup | 1 | ||||
-rw-r--r-- | tests/markups/valid-3.expected | 18 | ||||
-rw-r--r-- | tests/markups/valid-3.markup | 11 | ||||
-rw-r--r-- | tests/markups/valid-4.expected | 38 | ||||
-rw-r--r-- | tests/markups/valid-4.markup | 1 |
10 files changed, 96 insertions, 0 deletions
diff --git a/tests/markups/fail-1.expected b/tests/markups/fail-1.expected new file mode 100644 index 00000000..57d8818a --- /dev/null +++ b/tests/markups/fail-1.expected @@ -0,0 +1 @@ +ERROR: Attribute 'foo' is not allowed on the <span> tag on line 1 char 25
\ No newline at end of file diff --git a/tests/markups/fail-1.markup b/tests/markups/fail-1.markup new file mode 100644 index 00000000..df0c4872 --- /dev/null +++ b/tests/markups/fail-1.markup @@ -0,0 +1 @@ +<span foo="bar">blah</span> diff --git a/tests/markups/valid-1.expected b/tests/markups/valid-1.expected new file mode 100644 index 00000000..acd5f1b6 --- /dev/null +++ b/tests/markups/valid-1.expected @@ -0,0 +1,12 @@ +Blue text is cool! + + +--- + +range 0 9 +[0 9] scale 1.440000 +[0 9] foreground #00000000ffff +range 9 13 +range 13 17 +[13 17] style 2 +range 17 2147483647 diff --git a/tests/markups/valid-1.markup b/tests/markups/valid-1.markup new file mode 100644 index 00000000..3c7ea7d3 --- /dev/null +++ b/tests/markups/valid-1.markup @@ -0,0 +1 @@ +<markup><span foreground="blue" size="x-large">Blue text</span> is <span style="italic">cool</span>!</markup> diff --git a/tests/markups/valid-2.expected b/tests/markups/valid-2.expected new file mode 100644 index 00000000..acd5f1b6 --- /dev/null +++ b/tests/markups/valid-2.expected @@ -0,0 +1,12 @@ +Blue text is cool! + + +--- + +range 0 9 +[0 9] scale 1.440000 +[0 9] foreground #00000000ffff +range 9 13 +range 13 17 +[13 17] style 2 +range 17 2147483647 diff --git a/tests/markups/valid-2.markup b/tests/markups/valid-2.markup new file mode 100644 index 00000000..3e4136f1 --- /dev/null +++ b/tests/markups/valid-2.markup @@ -0,0 +1 @@ +<span foreground="blue" size="x-large">Blue text</span> is <span style="italic">cool</span>! diff --git a/tests/markups/valid-3.expected b/tests/markups/valid-3.expected new file mode 100644 index 00000000..f1030ea7 --- /dev/null +++ b/tests/markups/valid-3.expected @@ -0,0 +1,18 @@ +Lots of attrs + + +--- + +range 0 13 +[0 13] font Sans Italic 12 +[0 13] foreground #0000ffff0000 +[0 13] background #f0f0f0f0f0f0 +[0 13] underline 2 +[0 13] underline-color #ffff00000000 +[0 13] gravity 0 +[0 13] gravity-hint 1 +[0 13] strikethrough 1 +[0 13] strikethrough-color #00000000ffff +[0 13] fallback 0 +[0 13] language de +range 13 2147483647 diff --git a/tests/markups/valid-3.markup b/tests/markups/valid-3.markup new file mode 100644 index 00000000..c2f7ab86 --- /dev/null +++ b/tests/markups/valid-3.markup @@ -0,0 +1,11 @@ +<span font="Sans Italic 12" + foreground="#00ff00" + background="#f0f0f0" + underline="double" + underline_color="red" + strikethrough="true" + strikethrough_color="blue" + fallback="false" + lang="de" + gravity="south" + gravity_hint="strong">Lots of attrs</span> diff --git a/tests/markups/valid-4.expected b/tests/markups/valid-4.expected new file mode 100644 index 00000000..eb46086e --- /dev/null +++ b/tests/markups/valid-4.expected @@ -0,0 +1,38 @@ +bold big italic strikethroughsub smallsup tt underline + + +--- + +range 0 5 +[0 15] weight 700 +range 5 8 +[0 15] weight 700 +[5 8] scale 1.200000 +range 8 9 +[0 15] weight 700 +range 9 15 +[0 15] weight 700 +[9 15] style 2 +range 15 16 +range 16 29 +[16 41] strikethrough 1 +range 29 32 +[16 41] strikethrough 1 +[29 32] scale 0.833333 +[29 32] rise -5000 +range 32 33 +[16 41] strikethrough 1 +range 33 38 +[16 41] strikethrough 1 +[33 38] scale 0.833333 +range 38 41 +[16 41] strikethrough 1 +[38 41] scale 0.833333 +[38 41] rise 5000 +range 41 42 +range 42 45 +[42 54] family Monospace +range 45 54 +[42 54] family Monospace +[45 54] underline 1 +range 54 2147483647 diff --git a/tests/markups/valid-4.markup b/tests/markups/valid-4.markup new file mode 100644 index 00000000..d0e58f3a --- /dev/null +++ b/tests/markups/valid-4.markup @@ -0,0 +1 @@ +<b>bold <big>big</big> <i>italic</i></b> <s>strikethrough<sub>sub</sub> <small>small</small><sup>sup</sup></s> <tt>tt <u>underline</u></tt> |