[gtk/label-underline-markup] Add a mnemonic testcase
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/label-underline-markup] Add a mnemonic testcase
- Date: Tue, 15 Jun 2021 17:33:11 +0000 (UTC)
commit 89f57d4ff6e500d42f79d05ab4d691e540bc1eee
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Jun 15 13:32:31 2021 -0400
Add a mnemonic testcase
Add a testcase that tests the label mnemonic handling
that was fixed in the previous commit.
testsuite/gtk/label.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
---
diff --git a/testsuite/gtk/label.c b/testsuite/gtk/label.c
index c075e15139..3b1531a36b 100644
--- a/testsuite/gtk/label.c
+++ b/testsuite/gtk/label.c
@@ -196,12 +196,35 @@ test_label_markup (void)
gtk_window_destroy (GTK_WINDOW (window));
}
+static void
+test_label_underline (void)
+{
+ GtkWidget *window;
+ GtkWidget *label;
+
+ window = gtk_window_new ();
+
+ label = gtk_label_new ("");
+
+ gtk_window_set_child (GTK_WINDOW (window), label);
+ gtk_window_set_mnemonics_visible (GTK_WINDOW (window), TRUE);
+
+ gtk_label_set_use_markup (GTK_LABEL (label), FALSE);
+ gtk_label_set_use_underline (GTK_LABEL (label), TRUE);
+ gtk_label_set_label (GTK_LABEL (label), "tes_t & no markup <<");
+
+ g_assert_cmpint (gtk_label_get_mnemonic_keyval (GTK_LABEL (label)), ==, GDK_KEY_t);
+
+ gtk_window_destroy (GTK_WINDOW (window));
+}
+
int
main (int argc, char *argv[])
{
gtk_test_init (&argc, &argv);
g_test_add_func ("/label/markup-parse", test_label_markup);
+ g_test_add_func ("/label/underline-parse", test_label_underline);
return g_test_run ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]