testsuite: more focus-chain output

Differentiate between wrapping around and
stopping at the end of the focus chain.

Update the existing tests, and add two
new ones where the difference matters.
This commit is contained in:
Matthias Clasen 2019-06-11 14:53:08 +00:00
parent d2cde1fb2d
commit cfebff5dcf
6 changed files with 18 additions and 2 deletions

View File

@ -0,0 +1,3 @@
entry2 GtkText
entry1 GtkText
STOP

View File

@ -0,0 +1,3 @@
entry1 GtkText
entry2 GtkText
STOP

View File

@ -1,2 +1,3 @@
entry1 GtkText
entry2 GtkText
WRAP

View File

@ -1,2 +1,3 @@
entry2 GtkText
entry1 GtkText
WRAP

View File

@ -134,6 +134,8 @@ focus_chain_tests = [
# test direction
[ 'basic', 'tab' ],
[ 'basic', 'tab-backward' ],
[ 'basic', 'left' ],
[ 'basic', 'right' ],
]
focus_chain = executable(

View File

@ -123,10 +123,16 @@ generate_focus_chain (GtkWidget *window,
name = g_strdup ("NONE");
if (first && g_str_equal (name, first))
break; /* cycle completed */
{
g_string_append (output, "WRAP\n");
break; /* cycle completed */
}
if (last && g_str_equal (name, last))
break; /* dead end */
{
g_string_append (output, "STOP\n");
break; /* dead end */
}
g_string_append_printf (output, "%s\n", name);