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




commit bd1dbe1468044b18fe2566f0571091fd9792bc73
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 587fa252ac..94371bdd74 100644
--- a/testsuite/reftests/meson.build
+++ b/testsuite/reftests/meson.build
@@ -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',
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]