[gtk/wip/otte/center-center-center: 1/2] testsuite: Add a test for char wrapping




commit d56f7eeaa2393ac28934b2d1604ae7c0fca72bd6
Author: Benjamin Otte <otte redhat com>
Date:   Fri Oct 22 16:47:04 2021 +0200

    testsuite: Add a test for char wrapping

 testsuite/reftests/meson.build      |  2 ++
 testsuite/reftests/wrap-char.ref.ui | 20 ++++++++++++++++++++
 testsuite/reftests/wrap-char.ui     | 23 +++++++++++++++++++++++
 3 files changed, 45 insertions(+)
---
diff --git a/testsuite/reftests/meson.build b/testsuite/reftests/meson.build
index 8e1b8bd501..0017a4d9da 100644
--- a/testsuite/reftests/meson.build
+++ b/testsuite/reftests/meson.build
@@ -505,6 +505,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',
 ]
 
 # These need to be fixed but the issue hasn't been tracked down.
diff --git a/testsuite/reftests/wrap-char.ref.ui b/testsuite/reftests/wrap-char.ref.ui
new file mode 100644
index 0000000000..f3bcacfb60
--- /dev/null
+++ b/testsuite/reftests/wrap-char.ref.ui
@@ -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>
diff --git a/testsuite/reftests/wrap-char.ui b/testsuite/reftests/wrap-char.ui
new file mode 100644
index 0000000000..f8aa1b52ad
--- /dev/null
+++ b/testsuite/reftests/wrap-char.ui
@@ -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>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]