testsuite: Add test specifically for recent fix
authorBenjamin Otte <otte@redhat.com>
Mon, 18 Oct 2021 23:07:22 +0000 (01:07 +0200)
committerBenjamin Otte <otte@redhat.com>
Mon, 18 Oct 2021 23:10:59 +0000 (01:10 +0200)
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.

testsuite/reftests/label-max-width-chars-and-halign-and-infinite-width.ref.ui [new file with mode: 0644]
testsuite/reftests/label-max-width-chars-and-halign-and-infinite-width.ui [new file with mode: 0644]
testsuite/reftests/meson.build

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 (file)
index 0000000..68c5d0a
--- /dev/null
@@ -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 (file)
index 0000000..10dd7d2
--- /dev/null
@@ -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>
index d4322f5c637d11cb04e7d880181da1a5acebea49..6cad66c535b693e70f59be6b72e915db8a859656 100644 (file)
@@ -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',