summaryrefslogtreecommitdiffstats
path: root/tests/incr.test
diff options
context:
space:
mode:
authorandreask <andreask>2013-01-22 19:24:25 (GMT)
committerandreask <andreask>2013-01-22 19:24:25 (GMT)
commit6d8a36d84d2843681302604a082e2f787c3c3674 (patch)
tree9d3b4ee05189203cf7ce94b4b2a6d2d911aaa18d /tests/incr.test
parent296aebbd6ee092a25741684fa37ee31ef5a3e222 (diff)
downloadtcl-6d8a36d84d2843681302604a082e2f787c3c3674.zip
tcl-6d8a36d84d2843681302604a082e2f787c3c3674.tar.gz
tcl-6d8a36d84d2843681302604a082e2f787c3c3674.tar.bz2
Contribution by Patrick Fradin <patrick.fradin@planar.com>
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/incr.test')
-rw-r--r--tests/incr.test4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/incr.test b/tests/incr.test
index 9243be0..02b9338 100644
--- a/tests/incr.test
+++ b/tests/incr.test
@@ -16,7 +16,7 @@ if {"::tcltest" ni [namespace children]} {
}
unset -nocomplain x i
-proc readonly varName {
+proc readonly {varName} {
upvar 1 $varName var
trace add variable var write \
{apply {{args} {error "variable is read-only"}}}
@@ -230,7 +230,7 @@ test incr-1.29 {TclCompileIncrCmd: runtime error, bad variable value} -body {
incr x 1
} -returnCodes error -result {expected integer but got " - "}
test incr-1.30 {TclCompileIncrCmd: array var, braced (no subs)} -setup {
- catch {unset array}
+ unset -nocomplain array
} -body {
set array(\$foo) 4
incr {array($foo)}