diff options
author | andreask <andreask> | 2013-01-22 19:24:25 (GMT) |
---|---|---|
committer | andreask <andreask> | 2013-01-22 19:24:25 (GMT) |
commit | 6d8a36d84d2843681302604a082e2f787c3c3674 (patch) | |
tree | 9d3b4ee05189203cf7ce94b4b2a6d2d911aaa18d /tests/link.test | |
parent | 296aebbd6ee092a25741684fa37ee31ef5a3e222 (diff) | |
download | tcl-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/link.test')
-rw-r--r-- | tests/link.test | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/tests/link.test b/tests/link.test index 00e490c..ec310de 100644 --- a/tests/link.test +++ b/tests/link.test @@ -21,9 +21,7 @@ catch [list package require -exact Tcltest [info patchlevel]] testConstraint testlink [llength [info commands testlink]] -foreach i {int real bool string} { - unset -nocomplain $i -} +unset -nocomplain int real bool string test link-1.1 {reading C variables from Tcl} -constraints {testlink} -setup { testlink delete @@ -296,9 +294,7 @@ test link-8.3 {Tcl_UpdateLinkedVar procedure, read-only variable} {testlink} { catch {testlink set 0 0 0 - 0 0 0 0 0 0 0 0 0 0} catch {testlink delete} -foreach i {int real bool string wide} { - unset -nocomplain $i -} +unset -nocomplain int real bool string wide # cleanup ::tcltest::cleanupTests |