[gtk/label-sizing: 3/5] testsuite: Add test specifically for recent fix




commit 00214cbb4a4bf64a9d2de8aa084c9192a6f0d658
Author: Benjamin Otte <otte redhat com>
Date:   Tue Oct 19 01:07:22 2021 +0200

    testsuite: Add test specifically for recent fix
    
    label-sizing.ui tests this, too - but that test tests lots of other
    things, and if this ever happens again, we want to debug it in a small
    test.

 ...-width-chars-and-halign-and-infinite-width.ref.ui | 20 ++++++++++++++++++++
 ...-max-width-chars-and-halign-and-infinite-width.ui | 20 ++++++++++++++++++++
 testsuite/reftests/meson.build                       |  2 ++
 3 files changed, 42 insertions(+)
---
diff --git a/testsuite/reftests/label-max-width-chars-and-halign-and-infinite-width.ref.ui 
b/testsuite/reftests/label-max-width-chars-and-halign-and-infinite-width.ref.ui
new file mode 100644
index 0000000000..68c5d0a112
--- /dev/null
+++ b/testsuite/reftests/label-max-width-chars-and-halign-and-infinite-width.ref.ui
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <object class="GtkWindow" >
+    <property name="decorated">0</property>
+    <property name="width-request">200</property>
+    <child>
+      <object class="GtkLabel" >
+        <property name="halign">start</property>
+        <property name="valign">end</property>
+        <property name="xalign">0</property>
+        <property name="label" translatable="yes">ABCDE
+ABCD</property>
+        <property name="max_width_chars">4</property>
+        <attributes>
+          <attribute name="font-desc" value="Monospace"></attribute>
+        </attributes>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/testsuite/reftests/label-max-width-chars-and-halign-and-infinite-width.ui 
b/testsuite/reftests/label-max-width-chars-and-halign-and-infinite-width.ui
new file mode 100644
index 0000000000..10dd7d2d5a
--- /dev/null
+++ b/testsuite/reftests/label-max-width-chars-and-halign-and-infinite-width.ui
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <object class="GtkWindow" >
+    <property name="decorated">0</property>
+    <property name="width-request">200</property>
+    <child>
+      <object class="GtkLabel" >
+        <property name="halign">start</property>
+        <property name="valign">end</property>
+        <property name="label" translatable="yes">ABCDE ABCD</property>
+        <property name="xalign">0.0</property>
+        <property name="wrap">1</property>
+        <property name="max-width-chars">4</property>
+        <attributes>
+          <attribute name="font-desc" value="Monospace"></attribute>
+        </attributes>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/testsuite/reftests/meson.build b/testsuite/reftests/meson.build
index d4322f5c63..6cad66c535 100644
--- a/testsuite/reftests/meson.build
+++ b/testsuite/reftests/meson.build
@@ -314,6 +314,8 @@ testdata = [
   'label-fonts.css',
   'label-fonts.ref.ui',
   'label-fonts.ui',
+  'label-max-width-chars-and-halign-and-infinite-width.ui',
+  'label-max-width-chars-and-halign-and-infinite-width.ref.ui',
   'label-shadows.css',
   'label-shadows.ref.ui',
   'label-shadows.ui',


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