From 20d035df8daad6946c62976f7c92c2e3e4109c67 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 15 Jan 2018 22:25:30 +0000 Subject: Add three (currently failing) tests text-27.15[abc] that will pass when <> will fire from the text widget upon <>, or <>, when the text widget selection is impacted and it exports its selection (such events will therefore impact the PRIMARY selection, and this must trigger a <> event) --- tests/text.test | 51 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/tests/text.test b/tests/text.test index 07192e8..9e8ed9b 100644 --- a/tests/text.test +++ b/tests/text.test @@ -6395,9 +6395,9 @@ test text-27.14a {<> virtual event - propagation to peers} -body { } -cleanup { destroy .t .tt } -result {4} -test text-27.15 {<> virtual event} -body { +test text-27.15 {<> virtual event on sel tagging} -body { set ::retval no_selection - pack [text .t -undo 1] + pack [text .t] bind .t <> "set ::retval selection_changed" update idletasks .t insert end "nothing special\n" @@ -6407,6 +6407,53 @@ test text-27.15 {<> virtual event} -body { } -cleanup { destroy .t } -result {selection_changed} +test text-27.15a {<> virtual event on <>} -body { + pack [text .t -exportselection 1] + .t insert end "There is a PRIMARY selection in this text widget, " + .t insert end "and it will be impacted by the <> event received.\n" + .t insert end "Therefore a <> event must fire back." + .t tag add sel 1.0 1.28 + bind .t <> "set ::retval <>_fired" + update + set ::retval no_<>_event_fired + event generate .t <> -x 15 -y 3 + update + set ::retval +} -cleanup { + destroy .t +} -result {<>_fired} +test text-27.15b {<> virtual event on } -body { + pack [text .t -exportselection 1] + .t insert end "There is a PRIMARY selection in this text widget, " + .t insert end "and it will be impacted by the event received.\n" + .t insert end "Therefore a <> event must fire back." + .t tag add sel 1.0 1.28 + bind .t <> "set ::retval <>_fired" + update + set ::retval no_<>_event_fired + .t mark set insert 1.15 + focus .t + event generate .t + update + set ::retval +} -cleanup { + destroy .t +} -result {<>_fired} +test text-27.15c {<> virtual event on <>} -body { + pack [text .t -exportselection 1] + .t insert end "There is a PRIMARY selection in this text widget, " + .t insert end "and it will be impacted by the <> event received.\n" + .t insert end "Therefore a <> event must fire back." + .t tag add sel 1.0 1.28 + bind .t <> "set ::retval <>_fired" + update + set ::retval no_<>_event_fired + event generate .t <> + update + set ::retval +} -cleanup { + destroy .t +} -result {<>_fired} test text-27.16 {-maxundo configuration option} -body { text .t -undo 1 -autoseparators 1 -maxundo 2 pack .t -- cgit v0.12