summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-01-22 16:02:26 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-01-22 16:02:26 (GMT)
commit33a724f6c44c1c2ab31597a064b552f3d49e1fbf (patch)
tree033cad856ad1e2af38ca02748bc6b81478bd3c7c /tests
parent2931e05764b25ec1ac949a503b9691b1b7391793 (diff)
parentf68f95ac0fcee0b75243b53bc18e21d9ddcfa7bd (diff)
downloadtk-33a724f6c44c1c2ab31597a064b552f3d49e1fbf.zip
tk-33a724f6c44c1c2ab31597a064b552f3d49e1fbf.tar.gz
tk-33a724f6c44c1c2ab31597a064b552f3d49e1fbf.tar.bz2
patch 3471873: mark next/prev with peer text widgets
Diffstat (limited to 'tests')
-rw-r--r--tests/textMark.test65
1 files changed, 48 insertions, 17 deletions
diff --git a/tests/textMark.test b/tests/textMark.test
index c2810cc..174f674 100644
--- a/tests/textMark.test
+++ b/tests/textMark.test
@@ -19,7 +19,8 @@ pack append . .t {top expand fill}
update
.t debug on
wm geometry . {}
-
+.t peer create .pt
+
# The statements below reset the main window; it's needed if the window
# manager is mwm to make mwm forget about a previous minimum size setting.
@@ -175,47 +176,77 @@ test textMark-7.8 {MarkFindNext - no next mark} haveCourier12 {
.t mark set insert 3.0
.t mark next insert
} {}
-test textMark-8.1 {MarkFindPrev - invalid mark name} haveCourier12 {
+test textMark-7.9 {MarkFindNext - mark set in a text widget and retrieved from a peer} -setup {
+ .t mark unset {*}[.t mark names]
+} -body {
+ .t mark set mymark 1.0
+ set res [list [.pt mark next 1.0] [.pt mark next mymark] [.pt mark next insert]]
+} -result {mymark insert current}
+
+test textMark-8.1 {MarkFindPrev - invalid mark name} -constraints haveCourier12 -setup {
+ .t mark unset {*}[.t mark names]
+} -body {
catch {.t mark prev bogus} x
set x
-} {bad text index "bogus"}
-test textMark-8.2 {MarkFindPrev - marks at same location} haveCourier12 {
+} -result {bad text index "bogus"}
+test textMark-8.2 {MarkFindPrev - marks at same location} -constraints haveCourier12 -setup {
+ .t mark unset {*}[.t mark names]
+} -body {
.t mark set insert 2.0
.t mark set current 2.0
.t mark prev insert
-} {current}
-test textMark-8.3 {MarkFindPrev - numerical starting mark} haveCourier12 {
+} -result {current}
+test textMark-8.3 {MarkFindPrev - numerical starting mark} -constraints haveCourier12 -setup {
+ .t mark unset {*}[.t mark names]
+} -body {
.t mark set current 1.0
.t mark set insert 1.0
.t mark prev 1.1
-} {current}
-test textMark-8.4 {MarkFindPrev - mark on the same line} haveCourier12 {
+} -result {current}
+test textMark-8.4 {MarkFindPrev - mark on the same line} -setup {
+ .t mark unset {*}[.t mark names]
+} -body {
.t mark set current 1.0
.t mark set insert 1.1
.t mark prev insert
-} {current}
-test textMark-8.5 {MarkFindPrev - mark on the previous line} haveCourier12 {
+} -result {current}
+test textMark-8.5 {MarkFindPrev - mark on the previous line} -setup {
+ .t mark unset {*}[.t mark names]
+} -body {
.t mark set current 1.end
.t mark set insert 2.0
.t mark prev insert
-} {current}
-test textMark-8.6 {MarkFindPrev - mark far away} haveCourier12 {
+} -result {current}
+test textMark-8.6 {MarkFindPrev - mark far away} -constraints haveCourier12 -setup {
+ .t mark unset {*}[.t mark names]
+} -body {
.t mark set current 1.2
.t mark set insert 7.0
.t mark prev insert
-} {current}
-test textMark-8.7 {MarkFindPrev - mark on top of end} haveCourier12 {
+} -result {current}
+test textMark-8.7 {MarkFindPrev - mark on top of end} -constraints haveCourier12 -setup {
+ .t mark unset {*}[.t mark names]
+} -body {
.t mark set insert 3.0
.t mark set current end
.t mark prev end
-} {insert}
-test textMark-8.8 {MarkFindPrev - no previous mark} haveCourier12 {
+} -result {insert}
+test textMark-8.8 {MarkFindPrev - no previous mark} -constraints haveCourier12 -setup {
+ .t mark unset {*}[.t mark names]
+} -body {
.t mark set current 1.0
.t mark set insert 3.0
.t mark prev current
-} {}
+} -result {}
+test textMark-8.9 {MarkFindPrev - mark set in a text widget and retrieved from a peer} -setup {
+ .t mark unset {*}[.t mark names]
+} -body {
+ .t mark set mymark 1.0
+ set res [list [.pt mark prev end] [.pt mark prev current] [.pt mark prev insert]]
+} -result {current insert mymark}
catch {destroy .t}
+catch {destroy .pt}
# cleanup
cleanupTests