Version 1 of How to write tcltest result values

Updated 2002-08-12 13:48:10

I think I must not understand tcltest. I love to write tests, but I find it difficult to compose the correct result values to achieve null differences. When I'm off at all, tcltest floods my screen with more characters than I can digest. The only way I'm able to cope is by feeding the stdout from a tcltest run into

    set tmp /tmp/diff[pid]


    set report [read stdin]
    regexp -- {---- Result was:\n(.*?)---- Result should have been:\n(.*)====} \
          $report -> first second
    foreach part {first second} {
        set fp [open $tmp$part w]
        puts -nonewline $fp [set $part]
        close $fp
    }    
    catch {exec diff ${tmp}first ${tmp}second]} result
    puts "Result is:
    $result"

Is there an easier way?