Posted to tcl by miguel at Sun Jun 08 19:38:24 GMT 2008view raw
- ==== tree-tcl-4.4.17 error in walk FAILED
- ==== Contents of test case:
- set t [list ]
- proc foo {} {
- global t
- tree mytree
- mytree insert root end 0 1 2 3
- mytree insert 0 end a b c
- lappend t ==
- mytree walk root {a n} {
- if {[string equal $n "b"]} {
- lappend t .
- error fubar
- }
- lappend t $a $n
- }
- lappend t ==
- return bad-return
- }
- catch {lappend t [foo]} result
- mytree destroy
- list $t $result $::errorInfo
- ---- Result was:
- {== enter root enter 0 enter a .} fubar {fubar
- while executing
- "error fubar"
- ("WalkCall" body line 4)
- invoked from within
- "WalkCall $avar $nvar $name $node "enter" $script"
- (procedure "::struct::tree::_walk" line 88)
- invoked from within
- "::struct::tree::_walk ::mytree root {a n} {
- if {[string equal $n "b"]} {
- lappend t .
- error fubar
- }
- lappend t $a $n
- }"
- ("_walk" body line 1)
- invoked from within
- "mytree walk root {a n} {
- if {[string equal $n "b"]} {
- lappend t .
- error fubar
- }
- lappend t $a $n
- }"
- (procedure "foo" line 7)
- invoked from within
- "foo"}
- ---- Result should have been (exact matching):
- {== enter root enter 0 enter a .} fubar {fubar
- while executing
- "error fubar"
- invoked from within
- "if {[string equal $n "b"]} {
- lappend t .
- error fubar
- }"
- ("WalkCall" body line 2)
- invoked from within
- "WalkCall $avar $nvar $name $node "enter" $script"
- (procedure "::struct::tree::_walk" line 88)
- invoked from within
- "::struct::tree::_walk ::mytree root {a n} {
- if {[string equal $n "b"]} {
- lappend t .
- error fubar
- }
- lappend t $a $n
- }"
- ("_walk" body line 1)
- invoked from within
- "mytree walk root {a n} {
- if {[string equal $n "b"]} {
- lappend t .
- error fubar
- }
- lappend t $a $n
- }"
- (procedure "foo" line 7)
- invoked from within
- "foo"}
- ==== tree-tcl-4.4.17 FAILED