Test framework for TCL - Tcltest - some examplesTcl ships with the tcltest test suite / harness - and standard advice for coding is to write lots of tests and check with them every time you run your code.
There's a (new) first example [here] - loading in Tcltest and defining 3 tests:
package require tcltest
tcltest::test ...