summaryrefslogtreecommitdiffstats
path: root/tests/ttk/treeview.test
diff options
context:
space:
mode:
authorandreask <andreask>2013-01-22 19:30:43 (GMT)
committerandreask <andreask>2013-01-22 19:30:43 (GMT)
commit48c9fcb7281cc6aa076113db874c7ae0e105795d (patch)
tree7187940ff056462bfa41705a2ce04d0ed07d424e /tests/ttk/treeview.test
parent41f5d19540b0b3f053da352e1569c9a4ed019dd5 (diff)
downloadtk-contrib_patrick_fradin_code_cleanup.zip
tk-contrib_patrick_fradin_code_cleanup.tar.gz
tk-contrib_patrick_fradin_code_cleanup.tar.bz2
Contribution by Patrick Fradin <patrick.fradin@planar.com>contrib_patrick_fradin_code_cleanup
Quoting his mail: <pre> ========================================================== Hi Jeff, I spent some of my time to contribute to the TclTk community ! I'm in late for Christmas gift but like we said in French : "Mieux vaut tard que jamais". ;-) I've use TclDevKit 5.3.0 tclchecker to analyse TclTk code in Tcl and Tk library directories (library, tools and tests) to correct a lot of warnings and few errors. (encapsulate some expr, use 'chan xxx' instead of fconfigure, fileevent...) I've made some improvements too : Examples : - Use 'lassign' instead of many 'lindex' of 'foreach/break' loop. - Use 'in' or 'ni' operators instead of 'lsearch -exact' or to factorise some eq/ne && / || tests. - Use 'eq' or 'ne' to tests strings instead of '==' or '!='. - Use 'unset -nocomplain' to avoid 'catch {unset...}'. - Remove some useless catch around 'destroy' calls. - Use expand {*} instead of 'eval'. Don't touch a lot of code because I don't know all structs and lists. I think it could be a greater improvement to reduce 'eval' calls. Due to previous experience, I dot not change any indentation ! ;-) ========================================================== </pre>
Diffstat (limited to 'tests/ttk/treeview.test')
-rw-r--r--tests/ttk/treeview.test12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/ttk/treeview.test b/tests/ttk/treeview.test
index aa7e64a..9372e3f 100644
--- a/tests/ttk/treeview.test
+++ b/tests/ttk/treeview.test
@@ -4,7 +4,8 @@
#
package require Tk 8.5
-package require tcltest ; namespace import -force tcltest::*
+package require tcltest
+namespace import -force tcltest::*
loadTestedCommands
# consistencyCheck --
@@ -14,7 +15,7 @@ loadTestedCommands
# Since [$tv children] follows ->next links and [$tv index]
# follows ->prev links, this should cover all invariants.
#
-proc consistencyCheck {tv {item {}}} {
+proc consistencyCheck {tv {item ""}} {
set i 0;
foreach child [$tv children $item] {
assert {[$tv parent $child] == $item} "parent $child = $item"
@@ -334,7 +335,6 @@ test treeview-5.13 "get, no value" -body {
set result
} -result {}
-
test treeview-6.1 "deletion - setup" -body {
.tv insert {} end -id dtest
foreach id [list a b c d e] {
@@ -462,13 +462,15 @@ test treeview-8.5 "Selection - bad operation" -body {
### NEED: more tests for see/yview/scrolling
proc scrollcallback {args} {
- set ::scrolldata $args
+ global scrolldata
+ set scrolldata $args
}
test treeview-9.0 "scroll callback - empty tree" -body {
+ global scrolldata
.tv configure -yscrollcommand scrollcallback
.tv delete [.tv children {}]
update
- set ::scrolldata
+ set scrolldata
} -result [list 0.0 1.0]
### identify tests: