testsuite: Add a test for char wrapping

This commit is contained in:
Benjamin Otte
2021-10-22 16:47:04 +02:00
parent 491f124315
commit bd1dbe1468
3 changed files with 45 additions and 0 deletions

View File

@@ -566,6 +566,8 @@ testdata = [
# it is not in xfail since it succeeds on some platforms
#'window-show-contents-on-map.ref.ui',
#'window-show-contents-on-map.ui',
'wrap-char.ref.ui',
'wrap-char.ui',
'wrap-margin-align-critical.ref.ui',
'wrap-margin-align-critical.ui',
'wrapping-in-boxes-in-boxes.ref.ui',

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkWindow">
<!-- large enough for Hello World wrapped any which way -->
<property name="width_request">200</property>
<property name="height_request">100</property>
<property name="decorated">0</property>
<child>
<object class="GtkLabel">
<property name="label">Hello
World</property>
<property name="halign">center</property>
<property name="valign">center</property>
<attributes>
<attribute name="font-desc" value="Monospace"></attribute>
</attributes>
</object>
</child>
</object>
</interface>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkWindow">
<!-- large enough for Hello World wrapped any which way -->
<property name="width_request">200</property>
<property name="height_request">100</property>
<property name="decorated">0</property>
<child>
<object class="GtkLabel">
<property name="label">Hello World</property>
<!-- "Hello" and "World" are 5 characters each, so it should break perfectly -->
<property name="max-width-chars">5</property>
<property name="wrap">1</property>
<property name="wrap-mode">char</property>
<property name="halign">center</property>
<property name="valign">center</property>
<attributes>
<attribute name="font-desc" value="Monospace"></attribute>
</attributes>
</object>
</child>
</object>
</interface>