[gtk/wrap-label-fixup: 4/4] Add tests for the new wrap behavior
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wrap-label-fixup: 4/4] Add tests for the new wrap behavior
- Date: Wed, 13 Apr 2022 15:02:58 +0000 (UTC)
commit 696a8ae49c32e9d17d35bb2f982de936f1208864
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Apr 12 22:01:57 2022 -0400
Add tests for the new wrap behavior
.../label-nowrap-ellipsize-min-size.ref.ui | 13 ++++++++++++
.../reftests/label-nowrap-ellipsize-min-size.ui | 17 ++++++++++++++++
.../label-nowrap-ellipsize-nat-size.ref.ui | 12 +++++++++++
.../reftests/label-nowrap-ellipsize-nat-size.ui | 16 +++++++++++++++
.../reftests/label-nowrap-ellipsize-oversize.ui | 17 ++++++++++++++++
.../reftests/label-wrap-ellipsize-min-size.ref.ui | 14 +++++++++++++
.../reftests/label-wrap-ellipsize-min-size.ui | 23 ++++++++++++++++++++++
.../reftests/label-wrap-ellipsize-nat-size.ref.ui | 14 +++++++++++++
.../reftests/label-wrap-ellipsize-nat-size.ui | 17 ++++++++++++++++
.../reftests/label-wrap-ellipsize-oversize.ref.ui | 14 +++++++++++++
.../reftests/label-wrap-ellipsize-oversize.ui | 18 +++++++++++++++++
.../label-wrap-noellipsize-min-size.ref.ui | 16 +++++++++++++++
.../reftests/label-wrap-noellipsize-min-size.ui | 17 ++++++++++++++++
.../label-wrap-noellipsize-nat-size.ref.ui | 15 ++++++++++++++
.../reftests/label-wrap-noellipsize-nat-size.ui | 16 +++++++++++++++
.../label-wrap-noellipsize-oversize.ref.ui | 16 +++++++++++++++
.../reftests/label-wrap-noellipsize-oversize.ui | 17 ++++++++++++++++
testsuite/reftests/meson.build | 18 +++++++++++++++++
18 files changed, 290 insertions(+)
---
diff --git a/testsuite/reftests/label-nowrap-ellipsize-min-size.ref.ui
b/testsuite/reftests/label-nowrap-ellipsize-min-size.ref.ui
new file mode 100644
index 0000000000..54fe364dd3
--- /dev/null
+++ b/testsuite/reftests/label-nowrap-ellipsize-min-size.ref.ui
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="default-width">10</property>
+ <property name="default-height">1</property>
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">…</property>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/label-nowrap-ellipsize-min-size.ui
b/testsuite/reftests/label-nowrap-ellipsize-min-size.ui
new file mode 100644
index 0000000000..a13fc85d1e
--- /dev/null
+++ b/testsuite/reftests/label-nowrap-ellipsize-min-size.ui
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="default-width">10</property>
+ <property name="default-height">1</property>
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">Hello World multi line</property>
+ <property name="max-width-chars">2</property>
+ <property name="wrap-mode">word</property>
+ <property name="ellipsize">end</property>
+ <property name="lines">2</property>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/label-nowrap-ellipsize-nat-size.ref.ui
b/testsuite/reftests/label-nowrap-ellipsize-nat-size.ref.ui
new file mode 100644
index 0000000000..762b6f5d25
--- /dev/null
+++ b/testsuite/reftests/label-nowrap-ellipsize-nat-size.ref.ui
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="default-width">10</property>
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">…</property>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/label-nowrap-ellipsize-nat-size.ui
b/testsuite/reftests/label-nowrap-ellipsize-nat-size.ui
new file mode 100644
index 0000000000..efb7fb13cf
--- /dev/null
+++ b/testsuite/reftests/label-nowrap-ellipsize-nat-size.ui
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="default-width">10</property>
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">Hello World multi line</property>
+ <property name="max-width-chars">2</property>
+ <property name="wrap-mode">word</property>
+ <property name="ellipsize">end</property>
+ <property name="lines">2</property>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/label-nowrap-ellipsize-oversize.ui
b/testsuite/reftests/label-nowrap-ellipsize-oversize.ui
new file mode 100644
index 0000000000..06edf1bda3
--- /dev/null
+++ b/testsuite/reftests/label-nowrap-ellipsize-oversize.ui
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="default-width">10</property>
+ <property name="default-height">200</property>
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">Hello World multi line</property>
+ <property name="max-width-chars">2</property>
+ <property name="wrap-mode">word</property>
+ <property name="ellipsize">end</property>
+ <property name="lines">2</property>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/label-wrap-ellipsize-min-size.ref.ui
b/testsuite/reftests/label-wrap-ellipsize-min-size.ref.ui
new file mode 100644
index 0000000000..876e88a372
--- /dev/null
+++ b/testsuite/reftests/label-wrap-ellipsize-min-size.ref.ui
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="default-width">10</property>
+ <property name="default-height">1</property>
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">Hello
+W…</property>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/label-wrap-ellipsize-min-size.ui
b/testsuite/reftests/label-wrap-ellipsize-min-size.ui
new file mode 100644
index 0000000000..18ad5950ee
--- /dev/null
+++ b/testsuite/reftests/label-wrap-ellipsize-min-size.ui
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="default-width">10</property>
+ <!--- Set this:
+ 1 to test min height
+ remove it to test nat height
+ 200 to test oversize
+ -->
+ <property name="default-height">1</property>
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">Hello World multi line</property>
+ <property name="max-width-chars">2</property>
+ <property name="wrap-mode">word</property>
+ <property name="wrap">1</property>
+ <property name="ellipsize">end</property>
+ <property name="lines">2</property>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/label-wrap-ellipsize-nat-size.ref.ui
b/testsuite/reftests/label-wrap-ellipsize-nat-size.ref.ui
new file mode 100644
index 0000000000..876e88a372
--- /dev/null
+++ b/testsuite/reftests/label-wrap-ellipsize-nat-size.ref.ui
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="default-width">10</property>
+ <property name="default-height">1</property>
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">Hello
+W…</property>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/label-wrap-ellipsize-nat-size.ui
b/testsuite/reftests/label-wrap-ellipsize-nat-size.ui
new file mode 100644
index 0000000000..6c598a33b6
--- /dev/null
+++ b/testsuite/reftests/label-wrap-ellipsize-nat-size.ui
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="default-width">10</property>
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">Hello World multi line</property>
+ <property name="max-width-chars">2</property>
+ <property name="wrap-mode">word</property>
+ <property name="wrap">1</property>
+ <property name="ellipsize">end</property>
+ <property name="lines">2</property>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/label-wrap-ellipsize-oversize.ref.ui
b/testsuite/reftests/label-wrap-ellipsize-oversize.ref.ui
new file mode 100644
index 0000000000..10d67afefe
--- /dev/null
+++ b/testsuite/reftests/label-wrap-ellipsize-oversize.ref.ui
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="default-width">10</property>
+ <property name="default-height">200</property>
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">Hello
+W…</property>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/label-wrap-ellipsize-oversize.ui
b/testsuite/reftests/label-wrap-ellipsize-oversize.ui
new file mode 100644
index 0000000000..da8c16f3af
--- /dev/null
+++ b/testsuite/reftests/label-wrap-ellipsize-oversize.ui
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="default-width">10</property>
+ <property name="default-height">200</property>
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">Hello World multi line</property>
+ <property name="max-width-chars">2</property>
+ <property name="wrap-mode">word</property>
+ <property name="wrap">1</property>
+ <property name="ellipsize">end</property>
+ <property name="lines">2</property>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/label-wrap-noellipsize-min-size.ref.ui
b/testsuite/reftests/label-wrap-noellipsize-min-size.ref.ui
new file mode 100644
index 0000000000..9b4abc31ae
--- /dev/null
+++ b/testsuite/reftests/label-wrap-noellipsize-min-size.ref.ui
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="default-width">10</property>
+ <property name="default-height">1</property>
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">Hello
+World
+multi
+line</property>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/label-wrap-noellipsize-min-size.ui
b/testsuite/reftests/label-wrap-noellipsize-min-size.ui
new file mode 100644
index 0000000000..8a2f38351d
--- /dev/null
+++ b/testsuite/reftests/label-wrap-noellipsize-min-size.ui
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="default-width">10</property>
+ <property name="default-height">1</property>
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">Hello World multi line</property>
+ <property name="max-width-chars">2</property>
+ <property name="wrap-mode">word</property>
+ <property name="wrap">1</property>
+ <property name="lines">2</property>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/label-wrap-noellipsize-nat-size.ref.ui
b/testsuite/reftests/label-wrap-noellipsize-nat-size.ref.ui
new file mode 100644
index 0000000000..fb031c914f
--- /dev/null
+++ b/testsuite/reftests/label-wrap-noellipsize-nat-size.ref.ui
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="default-width">10</property>
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">Hello
+World
+multi
+line</property>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/label-wrap-noellipsize-nat-size.ui
b/testsuite/reftests/label-wrap-noellipsize-nat-size.ui
new file mode 100644
index 0000000000..97457a4c5f
--- /dev/null
+++ b/testsuite/reftests/label-wrap-noellipsize-nat-size.ui
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="default-width">10</property>
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">Hello World multi line</property>
+ <property name="max-width-chars">2</property>
+ <property name="wrap-mode">word</property>
+ <property name="wrap">1</property>
+ <property name="lines">2</property>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/label-wrap-noellipsize-oversize.ref.ui
b/testsuite/reftests/label-wrap-noellipsize-oversize.ref.ui
new file mode 100644
index 0000000000..2bc63be36a
--- /dev/null
+++ b/testsuite/reftests/label-wrap-noellipsize-oversize.ref.ui
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="default-width">10</property>
+ <property name="default-height">200</property>
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">Hello
+World
+multi
+line</property>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/label-wrap-noellipsize-oversize.ui
b/testsuite/reftests/label-wrap-noellipsize-oversize.ui
new file mode 100644
index 0000000000..310e3c7f5f
--- /dev/null
+++ b/testsuite/reftests/label-wrap-noellipsize-oversize.ui
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="default-width">10</property>
+ <property name="default-height">200</property>
+ <property name="decorated">0</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="label">Hello World multi line</property>
+ <property name="max-width-chars">2</property>
+ <property name="wrap-mode">word</property>
+ <property name="wrap">1</property>
+ <property name="lines">2</property>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/meson.build b/testsuite/reftests/meson.build
index 0b6d0fa84a..487084cb88 100644
--- a/testsuite/reftests/meson.build
+++ b/testsuite/reftests/meson.build
@@ -416,6 +416,24 @@ testdata = [
'label-wrap-word-char-natural-size.ui',
'label-wrapped-huge-max-width-chars.ref.ui',
'label-wrapped-huge-max-width-chars.ui',
+ 'label-wrap-ellipsize-min-size.ref.ui',
+ 'label-wrap-ellipsize-min-size.ui',
+ 'label-wrap-ellipsize-nat-size.ref.ui',
+ 'label-wrap-ellipsize-nat-size.ui',
+ 'label-wrap-ellipsize-oversize.ref.ui',
+ 'label-wrap-ellipsize-oversize.ui',
+ 'label-nowrap-ellipsize-min-size.ref.ui',
+ 'label-nowrap-ellipsize-min-size.ui',
+ 'label-nowrap-ellipsize-nat-size.ref.ui',
+ 'label-nowrap-ellipsize-nat-size.ui',
+ 'label-nowrap-ellipsize-oversize.ref.ui',
+ 'label-nowrap-ellipsize-oversize.ui',
+ 'label-wrap-noellipsize-min-size.ref.ui',
+ 'label-wrap-noellipsize-min-size.ui',
+ 'label-wrap-noellipsize-nat-size.ref.ui',
+ 'label-wrap-noellipsize-nat-size.ui',
+ 'label-wrap-noellipsize-oversize.ref.ui',
+ 'label-wrap-noellipsize-oversize.ui',
# this seems to make assumptions on text positioning
# that are not valid with subpixel positioning
#'label-wrap-justify.ref.ui',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]