diff options
author | Christian Hergert <chergert@redhat.com> | 2021-12-26 12:46:16 -0800 |
---|---|---|
committer | Christian Hergert <chergert@redhat.com> | 2021-12-26 12:46:16 -0800 |
commit | 99d8dd751e74bd383c7c0cc775cc6cd3ff2080ea (patch) | |
tree | bd44d59f1c1e4938df90543cd4425c0f48a0407e /testsuite | |
parent | 22b1abb36dcd159249906e3c264c5c329a430244 (diff) | |
download | gtk+-99d8dd751e74bd383c7c0cc775cc6cd3ff2080ea.tar.gz |
testsuite: add failing test for delete selection
This adds a test to expose the failure of #4575 which results in the
selection being incorrect when performing a delete as we are likely
already in a begin_user_action()/end_user_action() pair.
Related #4575
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/gtk/texthistory.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/gtk/texthistory.c b/testsuite/gtk/texthistory.c index 4da0dc5ab0..933c8611e9 100644 --- a/testsuite/gtk/texthistory.c +++ b/testsuite/gtk/texthistory.c @@ -619,6 +619,22 @@ test_issue_4276 (void) run_test (commands, G_N_ELEMENTS (commands), 0); } +static void +test_issue_4575 (void) +{ + const Command commands[] = { + { INSERT, 0, -1, "this is some text", "this is some text", SET, UNSET, UNSET }, + { SELECT, 5, 8, NULL, NULL, SET, UNSET, UNSET }, + { BEGIN_USER, -1, -1, NULL, NULL, UNSET, UNSET, UNSET }, + { DELETE_KEY, 5, 8, "is ", "this some text", UNSET, UNSET, UNSET, IGNORE_SELECT }, + { END_USER, -1, -1, NULL, NULL, SET, UNSET, UNSET }, + { UNDO, -1, -1, NULL, "this is some text", SET, SET, UNSET }, + { CHECK_SELECT, 5, 8, NULL, "this is some text", SET, SET, UNSET }, + }; + + run_test (commands, G_N_ELEMENTS (commands), 0); +} + int main (int argc, char *argv[]) @@ -640,6 +656,7 @@ main (int argc, g_test_add_func ("/Gtk/TextHistory/test13", test13); g_test_add_func ("/Gtk/TextHistory/test14", test14); g_test_add_func ("/Gtk/TextHistory/issue_4276", test_issue_4276); + g_test_add_func ("/Gtk/TextHistory/issue_4575", test_issue_4575); return g_test_run (); } |