diff options
author | fvogel <fvogelnew1@free.fr> | 2018-04-15 08:55:43 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2018-04-15 08:55:43 (GMT) |
commit | 510d1dc62777e065bb5e646f96ffec7411f78d94 (patch) | |
tree | d5a37841f9abfdf61430753c2fc8cd591c74c17f /tests/entry.test | |
parent | 4faa4997f4fd9227d43916f5909320d075cfd6e0 (diff) | |
parent | 62c05cfac502ae7f00a33eb7f95d14458897a915 (diff) | |
download | tk-510d1dc62777e065bb5e646f96ffec7411f78d94.zip tk-510d1dc62777e065bb5e646f96ffec7411f78d94.tar.gz tk-510d1dc62777e065bb5e646f96ffec7411f78d94.tar.bz2 |
merge trunk (because tip-496 does not target 8.6 but 8.7, whereas branch tip-496 was created off core-8-6-branch)
Diffstat (limited to 'tests/entry.test')
-rw-r--r-- | tests/entry.test | 322 |
1 files changed, 166 insertions, 156 deletions
diff --git a/tests/entry.test b/tests/entry.test index a8f7e16..7065343 100644 --- a/tests/entry.test +++ b/tests/entry.test @@ -16,7 +16,7 @@ proc scroll args { global scrollInfo set scrollInfo $args } -# For trace variable +# For trace variable proc override args { global x set x 12345 @@ -106,7 +106,7 @@ test entry-1.7 {configuration option: "borderwidth" for entry} -setup { update } -body { .e configure -borderwidth 1.3 - .e cget -borderwidth + .e cget -borderwidth } -cleanup { destroy .e } -result {1} @@ -221,7 +221,7 @@ test entry-1.18 {configuration option: "fg" for entry} -setup { } -returnCodes {error} -result {unknown color name "non-existent"} test entry-1.19 {configuration option: "font" for entry} -setup { - entry .e -borderwidth 2 -highlightthickness 2 + entry .e -borderwidth 2 -highlightthickness 2 pack .e update } -body { @@ -231,7 +231,7 @@ test entry-1.19 {configuration option: "font" for entry} -setup { destroy .e } -result {Helvetica -12} test entry-1.20 {configuration option: "font" for entry} -setup { - entry .e -borderwidth 2 -highlightthickness 2 + entry .e -borderwidth 2 -highlightthickness 2 pack .e update } -body { @@ -679,7 +679,7 @@ test entry-2.5 {Tk_EntryCmd procedure} -body { test entry-3.1 {EntryWidgetCmd procedure} -setup { - entry .e + entry .e pack .e update } -body { @@ -688,7 +688,7 @@ test entry-3.1 {EntryWidgetCmd procedure} -setup { destroy .e } -returnCodes error -result {wrong # args: should be ".e option ?arg ...?"} test entry-3.2 {EntryWidgetCmd procedure, "bbox" widget command} -setup { - entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 pack .e update } -body { @@ -697,7 +697,7 @@ test entry-3.2 {EntryWidgetCmd procedure, "bbox" widget command} -setup { destroy .e } -returnCodes error -result {wrong # args: should be ".e bbox index"} test entry-3.3 {EntryWidgetCmd procedure, "bbox" widget command} -setup { - entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 pack .e update } -body { @@ -706,7 +706,7 @@ test entry-3.3 {EntryWidgetCmd procedure, "bbox" widget command} -setup { destroy .e } -returnCodes error -result {wrong # args: should be ".e bbox index"} test entry-3.4 {EntryWidgetCmd procedure, "bbox" widget command} -setup { - entry .e + entry .e pack .e update } -body { @@ -715,7 +715,7 @@ test entry-3.4 {EntryWidgetCmd procedure, "bbox" widget command} -setup { destroy .e } -returnCodes error -result {bad entry index "bogus"} test entry-3.5 {EntryWidgetCmd procedure, "bbox" widget command} -setup { - entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 pack .e update } -body { @@ -724,7 +724,7 @@ test entry-3.5 {EntryWidgetCmd procedure, "bbox" widget command} -setup { destroy .e } -result [list 5 5 0 $cy] -# Previously the result was count using previousli counted font measurements +# Previously the result was count using previousli counted font measurements # and metrics. It was changed to less verbose solution - the result is the one # that passes fonts constraint (this concerns tests 3.6, 3.7, 3.8, 3.10) test entry-3.6 {EntryWidgetCmd procedure, "bbox" widget command} -constraints { @@ -743,7 +743,7 @@ test entry-3.6 {EntryWidgetCmd procedure, "bbox" widget command} -constraints { test entry-3.7 {EntryWidgetCmd procedure, "bbox" widget command} -constraints { fonts } -setup { - entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 pack .e update } -body { @@ -756,7 +756,7 @@ test entry-3.7 {EntryWidgetCmd procedure, "bbox" widget command} -constraints { test entry-3.8 {EntryWidgetCmd procedure, "bbox" widget command} -constraints { fonts } -setup { - entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 pack .e update } -body { @@ -767,7 +767,7 @@ test entry-3.8 {EntryWidgetCmd procedure, "bbox" widget command} -constraints { destroy .e } -result {31 5 7 13} test entry-3.9 {EntryWidgetCmd procedure, "bbox" widget command} -setup { - entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 pack .e update } -body { @@ -779,7 +779,7 @@ test entry-3.9 {EntryWidgetCmd procedure, "bbox" widget command} -setup { test entry-3.10 {EntryWidgetCmd procedure, "bbox" widget command} -constraints { fonts } -setup { - entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 pack .e update } -body { @@ -789,28 +789,28 @@ test entry-3.10 {EntryWidgetCmd procedure, "bbox" widget command} -constraints { destroy .e } -result {{5 5 7 13} {12 5 7 13} {75 5 12 13} {122 5 7 13}} test entry-3.11 {EntryWidgetCmd procedure, "cget" widget command} -setup { - entry .e + entry .e } -body { .e cget } -cleanup { destroy .e } -returnCodes error -result {wrong # args: should be ".e cget option"} test entry-3.12 {EntryWidgetCmd procedure, "cget" widget command} -setup { - entry .e + entry .e } -body { .e cget a b } -cleanup { destroy .e } -returnCodes error -result {wrong # args: should be ".e cget option"} test entry-3.13 {EntryWidgetCmd procedure, "cget" widget command} -setup { - entry .e + entry .e } -body { .e cget -gorp } -cleanup { destroy .e } -returnCodes error -result {unknown option "-gorp"} test entry-3.14 {EntryWidgetCmd procedure, "cget" widget command} -setup { - entry .e + entry .e } -body { .e configure -bd 4 .e cget -bd @@ -818,7 +818,7 @@ test entry-3.14 {EntryWidgetCmd procedure, "cget" widget command} -setup { destroy .e } -result {4} test entry-3.15 {EntryWidgetCmd procedure, "configure" widget command} -setup { - entry .e + entry .e pack .e update } -body { @@ -827,14 +827,14 @@ test entry-3.15 {EntryWidgetCmd procedure, "configure" widget command} -setup { destroy .e } -result {38} test entry-3.16 {EntryWidgetCmd procedure, "configure" widget command} -setup { - entry .e + entry .e } -body { .e configure -foo } -cleanup { destroy .e } -returnCodes error -result {unknown option "-foo"} test entry-3.17 {EntryWidgetCmd procedure, "configure" widget command} -setup { - entry .e + entry .e } -body { .e configure -bd 4 .e configure -bg #ffffff @@ -843,28 +843,28 @@ test entry-3.17 {EntryWidgetCmd procedure, "configure" widget command} -setup { destroy .e } -result {4} test entry-3.18 {EntryWidgetCmd procedure, "delete" widget command} -setup { - entry .e + entry .e } -body { .e delete } -cleanup { destroy .e } -returnCodes error -result {wrong # args: should be ".e delete firstIndex ?lastIndex?"} test entry-3.19 {EntryWidgetCmd procedure, "delete" widget command} -setup { - entry .e + entry .e } -body { .e delete a b c } -cleanup { destroy .e } -returnCodes error -result {wrong # args: should be ".e delete firstIndex ?lastIndex?"} test entry-3.20 {EntryWidgetCmd procedure, "delete" widget command} -setup { - entry .e + entry .e } -body { .e delete foo } -cleanup { destroy .e } -returnCodes error -result {bad entry index "foo"} test entry-3.21 {EntryWidgetCmd procedure, "delete" widget command} -setup { - entry .e + entry .e } -body { .e delete 0 bar } -cleanup { @@ -873,7 +873,7 @@ test entry-3.21 {EntryWidgetCmd procedure, "delete" widget command} -setup { test entry-3.22 {EntryWidgetCmd procedure, "delete" widget command} -setup { entry .e pack .e - update + update } -body { .e insert end "01234567890" .e delete 2 4 @@ -882,7 +882,7 @@ test entry-3.22 {EntryWidgetCmd procedure, "delete" widget command} -setup { destroy .e } -result {014567890} test entry-3.23 {EntryWidgetCmd procedure, "delete" widget command} -setup { - entry .e + entry .e } -body { .e insert end "01234567890" .e delete 6 @@ -893,7 +893,7 @@ test entry-3.23 {EntryWidgetCmd procedure, "delete" widget command} -setup { test entry-3.24 {EntryWidgetCmd procedure, "delete" widget command} -setup { entry .e pack .e - update + update set x {} } -body { # UTF @@ -914,7 +914,7 @@ test entry-3.24 {EntryWidgetCmd procedure, "delete" widget command} -setup { test entry-3.25 {EntryWidgetCmd procedure, "delete" widget command} -setup { entry .e pack .e - update + update } -body { .e insert end "01234567890" .e delete 6 5 @@ -925,7 +925,7 @@ test entry-3.25 {EntryWidgetCmd procedure, "delete" widget command} -setup { test entry-3.26 {EntryWidgetCmd procedure, "delete" widget command} -setup { entry .e pack .e - update + update } -body { .e insert end "01234567890" .e configure -state disabled @@ -938,7 +938,7 @@ test entry-3.26 {EntryWidgetCmd procedure, "delete" widget command} -setup { test entry-3.26a {EntryWidgetCmd procedure, "delete" widget command} -setup { entry .e pack .e - update + update } -body { .e insert end "01234567890" .e configure -state readonly @@ -949,28 +949,28 @@ test entry-3.26a {EntryWidgetCmd procedure, "delete" widget command} -setup { destroy .e } -result {01234567890} test entry-3.27 {EntryWidgetCmd procedure, "get" widget command} -setup { - entry .e + entry .e } -body { .e get foo } -cleanup { destroy .e } -returnCodes error -result {wrong # args: should be ".e get"} test entry-3.28 {EntryWidgetCmd procedure, "icursor" widget command} -setup { - entry .e + entry .e } -body { .e icursor } -cleanup { destroy .e } -returnCodes error -result {wrong # args: should be ".e icursor pos"} test entry-3.29 {EntryWidgetCmd procedure, "icursor" widget command} -setup { - entry .e + entry .e } -body { .e icursor foo } -cleanup { destroy .e } -returnCodes error -result {bad entry index "foo"} test entry-3.30 {EntryWidgetCmd procedure, "icursor" widget command} -setup { - entry .e + entry .e } -body { .e insert end "01234567890" .e icursor 4 @@ -979,21 +979,21 @@ test entry-3.30 {EntryWidgetCmd procedure, "icursor" widget command} -setup { destroy .e } -result {4} test entry-3.31 {EntryWidgetCmd procedure, "index" widget command} -setup { - entry .e + entry .e } -body { .e in } -cleanup { destroy .e } -returnCodes error -result {ambiguous option "in": must be bbox, cget, configure, delete, get, icursor, index, insert, scan, selection, validate, or xview} test entry-3.32 {EntryWidgetCmd procedure, "index" widget command} -setup { - entry .e + entry .e } -body { .e index } -cleanup { destroy .e } -returnCodes error -result {wrong # args: should be ".e index string"} test entry-3.33 {EntryWidgetCmd procedure, "index" widget command} -setup { - entry .e + entry .e } -body { .e index foo } -cleanup { @@ -1002,7 +1002,7 @@ test entry-3.33 {EntryWidgetCmd procedure, "index" widget command} -setup { test entry-3.34 {EntryWidgetCmd procedure, "index" widget command} -setup { entry .e pack .e - update + update } -body { .e index 0 } -cleanup { @@ -1011,7 +1011,7 @@ test entry-3.34 {EntryWidgetCmd procedure, "index" widget command} -setup { test entry-3.35 {EntryWidgetCmd procedure, "index" widget command} -setup { entry .e pack .e - update + update } -body { # UTF .e insert 0 abc\u4e4e\u0153def @@ -1020,21 +1020,21 @@ test entry-3.35 {EntryWidgetCmd procedure, "index" widget command} -setup { destroy .e } -result {3 4 8} test entry-3.36 {EntryWidgetCmd procedure, "insert" widget command} -setup { - entry .e + entry .e } -body { .e insert a } -cleanup { destroy .e } -returnCodes error -result {wrong # args: should be ".e insert index text"} test entry-3.37 {EntryWidgetCmd procedure, "insert" widget command} -setup { - entry .e + entry .e } -body { .e insert a b c } -cleanup { destroy .e } -returnCodes error -result {wrong # args: should be ".e insert index text"} test entry-3.38 {EntryWidgetCmd procedure, "insert" widget command} -setup { - entry .e + entry .e } -body { .e insert foo Text } -cleanup { @@ -1043,7 +1043,7 @@ test entry-3.38 {EntryWidgetCmd procedure, "insert" widget command} -setup { test entry-3.39 {EntryWidgetCmd procedure, "insert" widget command} -setup { entry .e pack .e - update + update } -body { .e insert end "01234567890" .e insert 3 xxx @@ -1054,7 +1054,7 @@ test entry-3.39 {EntryWidgetCmd procedure, "insert" widget command} -setup { test entry-3.40 {EntryWidgetCmd procedure, "insert" widget command} -setup { entry .e pack .e - update + update } -body { .e insert end "01234567890" .e configure -state disabled @@ -1067,7 +1067,7 @@ test entry-3.40 {EntryWidgetCmd procedure, "insert" widget command} -setup { test entry-3.40a {EntryWidgetCmd procedure, "insert" widget command} -setup { entry .e pack .e - update + update } -body { .e insert end "01234567890" .e configure -state readonly @@ -1078,14 +1078,14 @@ test entry-3.40a {EntryWidgetCmd procedure, "insert" widget command} -setup { destroy .e } -result {01234567890} test entry-3.41 {EntryWidgetCmd procedure, "insert" widget command} -setup { - entry .e + entry .e } -body { .e insert a b c } -cleanup { destroy .e } -returnCodes error -result {wrong # args: should be ".e insert index text"} test entry-3.42 {EntryWidgetCmd procedure, "scan" widget command} -setup { - entry .e + entry .e pack .e update } -body { @@ -1096,7 +1096,7 @@ test entry-3.42 {EntryWidgetCmd procedure, "scan" widget command} -setup { test entry-3.43 {EntryWidgetCmd procedure, "scan" widget command} -setup { entry .e pack .e - update + update } -body { .e scan a b c } -cleanup { @@ -1105,7 +1105,7 @@ test entry-3.43 {EntryWidgetCmd procedure, "scan" widget command} -setup { test entry-3.44 {EntryWidgetCmd procedure, "scan" widget command} -setup { entry .e pack .e - update + update } -body { .e scan foobar 20 } -cleanup { @@ -1114,7 +1114,7 @@ test entry-3.44 {EntryWidgetCmd procedure, "scan" widget command} -setup { test entry-3.45 {EntryWidgetCmd procedure, "scan" widget command} -setup { entry .e pack .e - update + update } -body { .e scan mark 20.1 } -cleanup { @@ -1125,7 +1125,7 @@ test entry-3.45 {EntryWidgetCmd procedure, "scan" widget command} -setup { test entry-3.46 {EntryWidgetCmd procedure, "scan" widget command} -constraints { fonts } -setup { - entry .e -font {Helvetica -12} -borderwidth 2 -highlightthickness 2 + entry .e -font {Helvetica -12} -borderwidth 2 -highlightthickness 2 pack .e update } -body { @@ -1138,14 +1138,14 @@ test entry-3.46 {EntryWidgetCmd procedure, "scan" widget command} -constraints { destroy .e } -result {2} test entry-3.47 {EntryWidgetCmd procedure, "select" widget command} -setup { - entry .e + entry .e } -body { .e select } -cleanup { destroy .e } -returnCodes error -result {wrong # args: should be ".e selection option ?index?"} test entry-3.48 {EntryWidgetCmd procedure, "select" widget command} -setup { - entry .e + entry .e } -body { .e select foo } -cleanup { @@ -1153,28 +1153,28 @@ test entry-3.48 {EntryWidgetCmd procedure, "select" widget command} -setup { } -returnCodes error -result {bad selection option "foo": must be adjust, clear, from, present, range, or to} test entry-3.49 {EntryWidgetCmd procedure, "select clear" widget command} -setup { - entry .e + entry .e } -body { .e select clear gorp } -cleanup { destroy .e } -returnCodes error -result {wrong # args: should be ".e selection clear"} test entry-3.50 {EntryWidgetCmd procedure, "select clear" widget command} -setup { - entry .e + entry .e } -body { .e insert end "0123456789" .e select from 1 .e select to 4 update .e select clear - selection get + selection get } -cleanup { destroy .e } -returnCodes error -result {PRIMARY selection doesn't exist or form "STRING" not defined} test entry-3.50.1 {EntryWidgetCmd procedure, "select clear" widget command} -setup { entry .e pack .e - update + update } -body { .e insert end "0123456789" .e select from 1 @@ -1188,7 +1188,7 @@ test entry-3.50.1 {EntryWidgetCmd procedure, "select clear" widget command} -set } -result {.e} test entry-3.51 {EntryWidgetCmd procedure, "selection present" widget command} -setup { - entry .e + entry .e } -body { .e selection present foo } -cleanup { @@ -1197,7 +1197,7 @@ test entry-3.51 {EntryWidgetCmd procedure, "selection present" widget command} - test entry-3.52 {EntryWidgetCmd procedure, "selection present" widget command} -setup { entry .e pack .e - update + update } -body { .e insert end 0123456789 .e select from 3 @@ -1209,7 +1209,7 @@ test entry-3.52 {EntryWidgetCmd procedure, "selection present" widget command} - test entry-3.53 {EntryWidgetCmd procedure, "selection present" widget command} -setup { entry .e pack .e - update + update } -body { .e insert end 0123456789 .e select from 3 @@ -1222,7 +1222,7 @@ test entry-3.53 {EntryWidgetCmd procedure, "selection present" widget command} - test entry-3.54 {EntryWidgetCmd procedure, "selection present" widget command} -setup { entry .e pack .e - update + update } -body { .e insert end 0123456789 .e select from 3 @@ -1361,7 +1361,7 @@ test entry-3.64b {EntryWidgetCmd procedure, "selection to" widget command} -setu } -returnCodes error -result {wrong # args: should be ".e selection to index"} test entry-3.65 {EntryWidgetCmd procedure, "xview" widget command} -setup { - entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 pack .e update } -body { @@ -1373,7 +1373,7 @@ test entry-3.65 {EntryWidgetCmd procedure, "xview" widget command} -setup { destroy .e } -result {0.0537634 0.2688172} test entry-3.66 {EntryWidgetCmd procedure, "xview" widget command} -setup { - entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 pack .e update } -body { @@ -1382,7 +1382,7 @@ test entry-3.66 {EntryWidgetCmd procedure, "xview" widget command} -setup { destroy .e } -returnCodes error -result {bad entry index "gorp"} test entry-3.67 {EntryWidgetCmd procedure, "xview" widget command} -setup { - entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 pack .e update } -body { @@ -1396,7 +1396,7 @@ test entry-3.67 {EntryWidgetCmd procedure, "xview" widget command} -setup { destroy .e } -result {0.107527 0.322581} test entry-3.68 {EntryWidgetCmd procedure, "xview" widget command} -setup { - entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 pack .e update } -body { @@ -1405,7 +1405,7 @@ test entry-3.68 {EntryWidgetCmd procedure, "xview" widget command} -setup { destroy .e } -returnCodes error -result {wrong # args: should be ".e xview moveto fraction"} test entry-3.69 {EntryWidgetCmd procedure, "xview" widget command} -setup { - entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 pack .e update } -body { @@ -1414,7 +1414,7 @@ test entry-3.69 {EntryWidgetCmd procedure, "xview" widget command} -setup { destroy .e } -returnCodes error -result {expected floating-point number but got "foo"} test entry-3.70 {EntryWidgetCmd procedure, "xview" widget command} -setup { - entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 pack .e update } -body { @@ -1426,7 +1426,7 @@ test entry-3.70 {EntryWidgetCmd procedure, "xview" widget command} -setup { destroy .e } -result {0.505376 0.720430} test entry-3.71 {EntryWidgetCmd procedure, "xview" widget command} -setup { - entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 pack .e update } -body { @@ -1437,7 +1437,7 @@ test entry-3.71 {EntryWidgetCmd procedure, "xview" widget command} -setup { destroy .e } -returnCodes error -result {wrong # args: should be ".e xview scroll number units|pages"} test entry-3.72 {EntryWidgetCmd procedure, "xview" widget command} -setup { - entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 pack .e } -body { .e insert end "This is quite a long text string, so long that it " @@ -1448,7 +1448,7 @@ test entry-3.72 {EntryWidgetCmd procedure, "xview" widget command} -setup { destroy .e } -returnCodes error -result {expected integer but got "gorp"} test entry-3.73 {EntryWidgetCmd procedure, "xview" widget command} -setup { - entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 pack .e } -body { .e insert end "This is quite a long text string, so long that it " @@ -1461,7 +1461,7 @@ test entry-3.73 {EntryWidgetCmd procedure, "xview" widget command} -setup { destroy .e } -result {0.193548 0.408602} test entry-3.74 {EntryWidgetCmd procedure, "xview" widget command} -setup { - entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 pack .e update } -body { @@ -1475,7 +1475,7 @@ test entry-3.74 {EntryWidgetCmd procedure, "xview" widget command} -setup { destroy .e } -result {0.397849 0.612903} test entry-3.75 {EntryWidgetCmd procedure, "xview" widget command} -setup { - entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 pack .e } -body { .e insert end "This is quite a long text string, so long that it " @@ -1483,13 +1483,13 @@ test entry-3.75 {EntryWidgetCmd procedure, "xview" widget command} -setup { update .e xview 30 update - .e xview scroll 2 units + .e xview scroll 2 units .e index @0 } -cleanup { destroy .e } -result {32} test entry-3.76 {EntryWidgetCmd procedure, "xview" widget command} -setup { - entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 pack .e } -body { .e insert end "This is quite a long text string, so long that it " @@ -1497,13 +1497,13 @@ test entry-3.76 {EntryWidgetCmd procedure, "xview" widget command} -setup { update .e xview 30 update - .e xview scroll -1 units + .e xview scroll -1 units .e index @0 } -cleanup { destroy .e } -result {29} test entry-3.77 {EntryWidgetCmd procedure, "xview" widget command} -setup { - entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 pack .e } -body { .e insert end "This is quite a long text string, so long that it " @@ -1514,7 +1514,7 @@ test entry-3.77 {EntryWidgetCmd procedure, "xview" widget command} -setup { destroy .e } -returnCodes error -result {bad argument "foobars": must be units or pages} test entry-3.78 {EntryWidgetCmd procedure, "xview" widget command} -setup { - entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 pack .e } -body { .e insert end "This is quite a long text string, so long that it " @@ -1525,7 +1525,7 @@ test entry-3.78 {EntryWidgetCmd procedure, "xview" widget command} -setup { destroy .e } -returnCodes error -result {unknown option "eat": must be moveto or scroll} test entry-3.79 {EntryWidgetCmd procedure, "xview" widget command} -setup { - entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 pack .e update } -body { @@ -1539,7 +1539,7 @@ test entry-3.79 {EntryWidgetCmd procedure, "xview" widget command} -setup { destroy .e } -result {0} test entry-3.80 {EntryWidgetCmd procedure, "xview" widget command} -setup { - entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 pack .e } -body { .e insert end "This is quite a long text string, so long that it " @@ -1551,7 +1551,7 @@ test entry-3.80 {EntryWidgetCmd procedure, "xview" widget command} -setup { destroy .e } -result {73} test entry-3.86 {EntryWidgetCmd procedure, "xview" widget command} -setup { - entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 pack .e } -body { .e insert end "This is quite a long text string, so long that it " @@ -1573,7 +1573,7 @@ test entry-3.86 {EntryWidgetCmd procedure, "xview" widget command} -setup { } -result {0.095745 0.106383 0.117021} test entry-3.82 {EntryWidgetCmd procedure} -setup { - entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 pack .e update } -body { @@ -1632,7 +1632,7 @@ test entry-5.4 {ConfigureEntry procedure, -textvariable} -setup { } -cleanup { destroy .e trace vdelete x w override - unset x; + unset x; } -result {12345 12345} test entry-5.5 {ConfigureEntry procedure} -setup { @@ -1657,14 +1657,14 @@ test entry-5.5 {ConfigureEntry procedure} -setup { destroy .e1 .e2 } -result {{This is so} {This is so} 1234} test entry-5.6 {ConfigureEntry procedure} -setup { - entry .e + entry .e pack .e } -body { .e insert end "0123456789" .e select from 1 .e select to 5 .e configure -exportselection 0 - selection get + selection get } -cleanup { destroy .e } -returnCodes error -result {PRIMARY selection doesn't exist or form "STRING" not defined} @@ -1676,14 +1676,14 @@ test entry-5.6.1 {ConfigureEntry procedure} -setup { .e select from 1 .e select to 5 .e configure -exportselection 0 - catch {selection get} + catch {selection get} list [.e index sel.first] [.e index sel.last] } -cleanup { destroy .e } -result {1 5} test entry-5.7 {ConfigureEntry procedure} -setup { - entry .e -font {Helvetica -12} -borderwidth 2 -highlightthickness 2 + entry .e -font {Helvetica -12} -borderwidth 2 -highlightthickness 2 pack .e } -body { .e configure -font {Courier -12} -width 4 -xscrollcommand scroll @@ -1699,7 +1699,7 @@ test entry-5.7 {ConfigureEntry procedure} -setup { test entry-5.8 {ConfigureEntry procedure} -constraints { fonts } -setup { - entry .e -borderwidth 2 -highlightthickness 2 + entry .e -borderwidth 2 -highlightthickness 2 pack .e } -body { .e configure -width 0 -font {Helvetica -12} @@ -1754,7 +1754,7 @@ test entry-5.11 {ConfigureEntry procedure} -setup { test entry-6.1 {EntryComputeGeometry procedure} -constraints { fonts } -setup { - entry .e + entry .e pack .e } -body { .e configure -font {Courier -12} -bd 2 -relief raised -width 20 \ @@ -1768,7 +1768,7 @@ test entry-6.1 {EntryComputeGeometry procedure} -constraints { test entry-6.2 {EntryComputeGeometry procedure} -constraints { fonts } -setup { - entry .e + entry .e pack .e } -body { .e configure -font {Courier -12} -bd 2 -relief raised -width 20 \ @@ -1782,7 +1782,7 @@ test entry-6.2 {EntryComputeGeometry procedure} -constraints { test entry-6.3 {EntryComputeGeometry procedure} -constraints { fonts } -setup { - entry .e + entry .e pack .e } -body { .e configure -font {Courier -12} -bd 2 -relief raised -width 20 \ @@ -1794,7 +1794,7 @@ test entry-6.3 {EntryComputeGeometry procedure} -constraints { destroy .e } -result {3 4} test entry-6.4 {EntryComputeGeometry procedure} -setup { - entry .e + entry .e pack .e } -body { .e configure -font {Courier -12} -bd 2 -relief raised -width 5 @@ -1809,7 +1809,7 @@ test entry-6.5 {EntryComputeGeometry procedure} -setup { entry .e -highlightthickness 2 pack .e } -body { - .e configure -font {Courier -12} -bd 2 -relief raised -width 5 + .e configure -font {Courier -12} -bd 2 -relief raised -width 5 .e insert end "01234567890" update .e xview 7 @@ -1823,7 +1823,7 @@ test entry-6.6 {EntryComputeGeometry procedure} -constraints { entry .e -highlightthickness 2 pack .e } -body { - .e configure -font {Courier -12} -bd 2 -relief raised -width 10 + .e configure -font {Courier -12} -bd 2 -relief raised -width 10 .e insert end "01234\t67890" update .e xview 3 @@ -1863,14 +1863,14 @@ test entry-6.9 {EntryComputeGeometry procedure} -constraints { entry .e -highlightthickness 2 pack .e } -body { - .e configure -font {Helvetica -24} -bd 3 -relief raised -width 0 + .e configure -font {Helvetica -24} -bd 3 -relief raised -width 0 update list [winfo reqwidth .e] [winfo reqheight .e] } -cleanup { destroy .e } -result {25 39} test entry-6.10 {EntryComputeGeometry procedure} -constraints { - unix fonts + unix fonts } -setup { entry .e -highlightthickness 2 -font {Helvetica -12} pack .e @@ -1925,7 +1925,7 @@ test entry-6.12 {EntryComputeGeometry procedure} -constraints { test entry-7.1 {InsertChars procedure} -setup { - unset -nocomplain contents + unset -nocomplain contents entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 pack .e focus .e @@ -1940,8 +1940,8 @@ test entry-7.1 {InsertChars procedure} -setup { } -result {abXXXcde abXXXcde {0.000000 1.000000}} test entry-7.2 {InsertChars procedure} -setup { - unset -nocomplain contents - entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + unset -nocomplain contents + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 pack .e focus .e } -body { @@ -2010,7 +2010,7 @@ test entry-7.6 {InsertChars procedure} -setup { destroy .e } -result {2 6 2 5} test entry-7.7 {InsertChars procedure} -setup { - entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 pack .e } -body { .e configure -xscrollcommand scroll @@ -2022,7 +2022,7 @@ test entry-7.7 {InsertChars procedure} -setup { destroy .e } -result {7} test entry-7.8 {InsertChars procedure} -setup { - entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 pack .e } -body { .e insert 0 0123456789 @@ -2033,7 +2033,7 @@ test entry-7.8 {InsertChars procedure} -setup { destroy .e } -result {4} test entry-7.9 {InsertChars procedure} -setup { - entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 pack .e } -body { .e insert 0 "This is a very long string" @@ -2045,7 +2045,7 @@ test entry-7.9 {InsertChars procedure} -setup { destroy .e } -result {7} test entry-7.10 {InsertChars procedure} -setup { - entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 pack .e } -body { .e insert 0 "This is a very long string" @@ -2060,7 +2060,7 @@ test entry-7.10 {InsertChars procedure} -setup { test entry-7.11 {InsertChars procedure} -constraints { fonts } -setup { - entry .e -width 0 -font {Courier -12} -highlightthickness 2 -bd 2 + entry .e -width 0 -font {Courier -12} -highlightthickness 2 -bd 2 pack .e } -body { .e insert 0 "xyzzy" @@ -2073,7 +2073,7 @@ test entry-7.11 {InsertChars procedure} -constraints { test entry-8.1 {DeleteChars procedure} -setup { unset -nocomplain contents - entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 pack .e focus .e } -body { @@ -2087,7 +2087,7 @@ test entry-8.1 {DeleteChars procedure} -setup { } -result {abe abe {0.000000 1.000000}} test entry-8.2 {DeleteChars procedure} -setup { unset -nocomplain contents - entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 pack .e focus .e } -body { @@ -2101,7 +2101,7 @@ test entry-8.2 {DeleteChars procedure} -setup { } -result {cde cde {0.000000 1.000000}} test entry-8.3 {DeleteChars procedure} -setup { unset -nocomplain contents - entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 pack .e focus .e } -body { @@ -2114,7 +2114,7 @@ test entry-8.3 {DeleteChars procedure} -setup { destroy .e } -result {abc abc {0.000000 1.000000}} test entry-8.4 {DeleteChars procedure} -setup { - entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 pack .e focus .e } -body { @@ -2130,7 +2130,7 @@ test entry-8.4 {DeleteChars procedure} -setup { destroy .e } -result {1 6 1 5} test entry-8.5 {DeleteChars procedure} -setup { - entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 pack .e focus .e } -body { @@ -2146,7 +2146,7 @@ test entry-8.5 {DeleteChars procedure} -setup { destroy .e } -result {1 5 1 4} test entry-8.6 {DeleteChars procedure} -setup { - entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 pack .e focus .e } -body { @@ -2162,7 +2162,7 @@ test entry-8.6 {DeleteChars procedure} -setup { destroy .e } -result {1 2 1 5} test entry-8.7 {DeleteChars procedure} -setup { - entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 pack .e focus .e } -body { @@ -2176,7 +2176,7 @@ test entry-8.7 {DeleteChars procedure} -setup { destroy .e } -returnCodes error -result {selection isn't in widget .e} test entry-8.8 {DeleteChars procedure} -setup { - entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 pack .e focus .e } -body { @@ -2192,7 +2192,7 @@ test entry-8.8 {DeleteChars procedure} -setup { destroy .e } -result {3 4 3 8} test entry-8.9 {DeleteChars procedure} -setup { - entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 pack .e } -body { .e insert 0 0123456789abcde @@ -2205,7 +2205,7 @@ test entry-8.9 {DeleteChars procedure} -setup { destroy .e } -returnCodes error -result {selection isn't in widget .e} test entry-8.10 {DeleteChars procedure} -setup { - entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 pack .e focus .e } -body { @@ -2221,7 +2221,7 @@ test entry-8.10 {DeleteChars procedure} -setup { destroy .e } -result {3 5 5 8} test entry-8.11 {DeleteChars procedure} -setup { - entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 pack .e focus .e } -body { @@ -2237,7 +2237,7 @@ test entry-8.11 {DeleteChars procedure} -setup { destroy .e } -result {3 8 4 8} test entry-8.12 {DeleteChars procedure} -setup { - entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 pack .e focus .e } -body { @@ -2250,7 +2250,7 @@ test entry-8.12 {DeleteChars procedure} -setup { destroy .e } -result {1} test entry-8.13 {DeleteChars procedure} -setup { - entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 pack .e focus .e } -body { @@ -2263,7 +2263,7 @@ test entry-8.13 {DeleteChars procedure} -setup { destroy .e } -result {1} test entry-8.14 {DeleteChars procedure} -setup { - entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 pack .e focus .e } -body { @@ -2276,7 +2276,7 @@ test entry-8.14 {DeleteChars procedure} -setup { destroy .e } -result {4} test entry-8.15 {DeleteChars procedure} -setup { - entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 pack .e focus .e } -body { @@ -2289,7 +2289,7 @@ test entry-8.15 {DeleteChars procedure} -setup { destroy .e } -result {1} test entry-8.16 {DeleteChars procedure} -setup { - entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 pack .e focus .e } -body { @@ -2302,7 +2302,7 @@ test entry-8.16 {DeleteChars procedure} -setup { destroy .e } -result {1} test entry-8.17 {DeleteChars procedure} -setup { - entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 pack .e focus .e } -body { @@ -2315,17 +2315,27 @@ test entry-8.17 {DeleteChars procedure} -setup { destroy .e } -result {4} test entry-8.18 {DeleteChars procedure} -setup { - entry .e -width 0 -font {Courier -12} -highlightthickness 2 -bd 2 + entry .e -width 0 -font {Courier -12} -highlightthickness 2 -bd 2 pack .e focus .e } -body { .e insert 0 "xyzzy" update .e delete 2 4 - winfo reqwidth .e -} -cleanup { - destroy .e -} -result {31} + # To check that deletion actually happened we measure the new width + # of the widget, based on the measuring width of the remaining text ("xyy") + # in the widget. For that purpose we have to mirror the code in tkEntry.c + # for computation of the reqwidth + # note: XPAD corresponds to the hardcoded #define XPAD 1 + set XPAD 1 + set expected [expr { [font measure [.e cget -font] "xyy"] \ + + 2 * ( [.e cget -borderwidth] + \ + [.e cget -highlightthickness] + $XPAD ) } ] + expr {[winfo reqwidth .e] == $expected} +} -cleanup { + destroy .e + unset XPAD expected +} -result {1} test entry-9.1 {EntryValueChanged procedure} -setup { unset -nocomplain x @@ -2346,7 +2356,7 @@ test entry-10.1 {EntrySetValue procedure} -constraints fonts -body { set y ab entry .e -font {Helvetica -12} -highlightthickness 2 -bd 2 -width 0 pack .e - .e configure -textvariable x + .e configure -textvariable x .e configure -textvariable y update list [.e get] [winfo reqwidth .e] @@ -2355,7 +2365,7 @@ test entry-10.1 {EntrySetValue procedure} -constraints fonts -body { } -result {ab 24} test entry-10.2 {EntrySetValue procedure, updating selection} -setup { unset -nocomplain x - entry .e -font {Helvetica -12} -highlightthickness 2 -bd 2 + entry .e -font {Helvetica -12} -highlightthickness 2 -bd 2 pack .e } -body { .e configure -textvariable x @@ -2368,7 +2378,7 @@ test entry-10.2 {EntrySetValue procedure, updating selection} -setup { } -returnCodes error -result {selection isn't in widget .e} test entry-10.3 {EntrySetValue procedure, updating selection} -setup { unset -nocomplain x - entry .e -font {Helvetica -12} -highlightthickness 2 -bd 2 + entry .e -font {Helvetica -12} -highlightthickness 2 -bd 2 pack .e } -body { .e configure -textvariable x @@ -2381,7 +2391,7 @@ test entry-10.3 {EntrySetValue procedure, updating selection} -setup { } -result {4 7} test entry-10.4 {EntrySetValue procedure, updating selection} -setup { unset -nocomplain x - entry .e -font {Helvetica -12} -highlightthickness 2 -bd 2 + entry .e -font {Helvetica -12} -highlightthickness 2 -bd 2 pack .e } -body { .e configure -textvariable x @@ -2394,7 +2404,7 @@ test entry-10.4 {EntrySetValue procedure, updating selection} -setup { } -result {4 10} test entry-10.5 {EntrySetValue procedure, updating display position} -setup { unset -nocomplain x - entry .e -highlightthickness 2 -bd 2 + entry .e -highlightthickness 2 -bd 2 pack .e } -body { .e configure -width 10 -font {Courier -12} -textvariable x @@ -2409,7 +2419,7 @@ test entry-10.5 {EntrySetValue procedure, updating display position} -setup { } -result {0} test entry-10.6 {EntrySetValue procedure, updating display position} -setup { unset -nocomplain x - entry .e -highlightthickness 2 -bd 2 + entry .e -highlightthickness 2 -bd 2 pack .e } -body { .e configure -width 10 -font {Courier -12} -textvariable x @@ -2425,7 +2435,7 @@ test entry-10.6 {EntrySetValue procedure, updating display position} -setup { } -result {10} test entry-10.7 {EntrySetValue procedure, updating insertion cursor} -setup { unset -nocomplain x - entry .e -highlightthickness 2 -bd 2 + entry .e -highlightthickness 2 -bd 2 pack .e update } -body { @@ -2440,7 +2450,7 @@ test entry-10.7 {EntrySetValue procedure, updating insertion cursor} -setup { } -result {3} test entry-10.8 {EntrySetValue procedure, updating insertion cursor} -setup { unset -nocomplain x - entry .e -highlightthickness 2 -bd 2 + entry .e -highlightthickness 2 -bd 2 pack .e } -body { .e configure -width 10 -font {Courier -12} -textvariable x @@ -2497,7 +2507,7 @@ test entry-13.1 {GetEntryIndex procedure} -setup { destroy .e } -result {21} test entry-13.2 {GetEntryIndex procedure} -body { - entry .e + entry .e .e index abogus } -cleanup { destroy .e @@ -2588,7 +2598,7 @@ test entry-13.9 {GetEntryIndex procedure} -setup { test entry-13.10 {GetEntryIndex procedure} -constraints x11 -body { -# On unix, when selection is cleared, entry widget's internal +# On unix, when selection is cleared, entry widget's internal # selection range is reset. # Previous settings: entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken @@ -2608,7 +2618,7 @@ test entry-13.10 {GetEntryIndex procedure} -constraints x11 -body { test entry-13.11 {GetEntryIndex procedure} -constraints aquaOrWin32 -body { # On mac and pc, when selection is cleared, entry widget remembers -# last selected range. When selection ownership is restored to +# last selected range. When selection ownership is restored to # entry, the old range will be rehighlighted. # Previous settings: entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken @@ -2625,7 +2635,7 @@ test entry-13.11 {GetEntryIndex procedure} -constraints aquaOrWin32 -body { .e index sel.first } -cleanup { destroy .e -} -result {1} +} -result {1} test entry-13.12 {GetEntryIndex procedure} -constraints x11 -body { # Previous settings: @@ -2644,7 +2654,7 @@ test entry-13.12 {GetEntryIndex procedure} -constraints x11 -body { destroy .e } -returnCodes error -result {selection isn't in widget .e} -# why when string in .e index changed to not beginning with s, +# why when string in .e index changed to not beginning with s, # it behaves differently? test entry-13.12.1 {GetEntryIndex procedure} -constraints unix -body { # Previous settings: @@ -2682,7 +2692,7 @@ test entry-13.13 {GetEntryIndex procedure} -constraints win -body { test entry-13.14 {GetEntryIndex procedure} -constraints win -body { # On mac and pc, when selection is cleared, entry widget remembers -# last selected range. When selection ownership is restored to +# last selected range. When selection ownership is restored to # entry, the old range will be rehighlighted. # Previous settings: entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken @@ -2695,14 +2705,14 @@ test entry-13.14 {GetEntryIndex procedure} -constraints win -body { list [.e index sel.first] [.e index sel.last] # Testing: selection clear .e - selection get + selection get } -cleanup { destroy .e } -returnCodes error -match glob -result {*} test entry-13.14.1 {GetEntryIndex procedure} -constraints win -body { # On mac and pc, when selection is cleared, entry widget remembers -# last selected range. When selection ownership is restored to +# last selected range. When selection ownership is restored to # entry, the old range will be rehighlighted. # Previous settings: entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken @@ -2714,9 +2724,9 @@ test entry-13.14.1 {GetEntryIndex procedure} -constraints win -body { .e select to 6 list [.e index sel.first] [.e index sel.last] # Testing: - selection clear .e - catch {selection get} - .e index sbogus + selection clear .e + catch {selection get} + .e index sbogus } -cleanup { destroy .e } -returnCodes error -match glob -result {*} @@ -2731,7 +2741,7 @@ test entry-13.15 {GetEntryIndex procedure} -body { test entry-13.16 {GetEntryIndex procedure} -constraints fonts -body { entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\ - -font {Courier -12} + -font {Courier -12} pack .e .e insert 0 012345678901234567890 .e xview 4 @@ -2764,7 +2774,7 @@ test entry-13.18 {GetEntryIndex procedure} -constraints fonts -body { } -result {5} test entry-13.19 {GetEntryIndex procedure} -constraints fonts -body { entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\ - -font {Courier -12} + -font {Courier -12} pack .e .e insert 0 012345678901234567890 .e xview 4 @@ -2796,7 +2806,7 @@ test entry-13.21 {GetEntryIndex procedure} -body { destroy .e } -result {9} test entry-13.22 {GetEntryIndex procedure} -setup { - entry .e + entry .e pack .e update } -body { @@ -2806,7 +2816,7 @@ test entry-13.22 {GetEntryIndex procedure} -setup { } -returnCodes error -result {bad entry index "1xyz"} test entry-13.23 {GetEntryIndex procedure} -body { entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\ - -font {Courier -12} + -font {Courier -12} pack .e .e insert 0 012345678901234567890 .e xview 4 @@ -2817,7 +2827,7 @@ test entry-13.23 {GetEntryIndex procedure} -body { } -result {0} test entry-13.24 {GetEntryIndex procedure} -body { entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\ - -font {Courier -12} + -font {Courier -12} pack .e .e insert 0 012345678901234567890 .e xview 4 @@ -2828,7 +2838,7 @@ test entry-13.24 {GetEntryIndex procedure} -body { } -result {12} test entry-13.25 {GetEntryIndex procedure} -body { entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\ - -font {Courier -12} + -font {Courier -12} pack .e .e insert 0 012345678901234567890 .e xview 4 @@ -2877,7 +2887,7 @@ test entry-14.3 {EntryFetchSelection procedure} -setup { } } -body { entry .e - .e insert end $x + .e insert end $x .e select from 0 .e select to end string compare [selection get] $x @@ -2904,7 +2914,7 @@ test entry-16.1 {EntryVisibleRange procedure} -constraints fonts -body { entry .e -width 10 -font {Helvetica -12} pack .e update - .e insert 0 "............................." + .e insert 0 "............................." format {%.6f %.6f} {*}[.e xview] } -cleanup { destroy .e @@ -2997,7 +3007,7 @@ test entry-18.1 {Entry widget vs hiding} -setup { set res1 [list [winfo children .] [interp hidden]] set res2 [list {} $l] expr {$res1 == $res2} -} -result {1} +} -result {1} ## ## Entry widget VALIDATION tests @@ -3351,7 +3361,7 @@ test entry-19.19 {entry widget validation} -setup { -background red -foreground white pack .e set ::e nextdata ;# previous settings - + .e configure -validatecommand [list doval2 %W %d %i %P %s %S %v %V] .e validate list [.e cget -validate] [.e get] $::vVals @@ -3376,7 +3386,7 @@ test entry-19.20 {entry widget validation} -setup { set ::e nextdata ;# previous settings .e configure -validatecommand [list doval2 %W %d %i %P %s %S %v %V] ;# prev .e validate ;# previous settings - + .e configure -validate all set ::e testdata list [.e cget -validate] [.e get] $::e $::vVals |