Posted to tcl by miguel at Sun Jun 08 19:38:24 GMT 2008view raw

  1. ==== tree-tcl-4.4.17 error in walk FAILED
  2. ==== Contents of test case:
  3.  
  4. set t [list ]
  5. proc foo {} {
  6. global t
  7. tree mytree
  8. mytree insert root end 0 1 2 3
  9. mytree insert 0 end a b c
  10. lappend t ==
  11. mytree walk root {a n} {
  12. if {[string equal $n "b"]} {
  13. lappend t .
  14. error fubar
  15. }
  16. lappend t $a $n
  17. }
  18. lappend t ==
  19. return bad-return
  20. }
  21. catch {lappend t [foo]} result
  22. mytree destroy
  23. list $t $result $::errorInfo
  24.  
  25. ---- Result was:
  26. {== enter root enter 0 enter a .} fubar {fubar
  27. while executing
  28. "error fubar"
  29. ("WalkCall" body line 4)
  30. invoked from within
  31. "WalkCall $avar $nvar $name $node "enter" $script"
  32. (procedure "::struct::tree::_walk" line 88)
  33. invoked from within
  34. "::struct::tree::_walk ::mytree root {a n} {
  35. if {[string equal $n "b"]} {
  36. lappend t .
  37. error fubar
  38. }
  39. lappend t $a $n
  40. }"
  41. ("_walk" body line 1)
  42. invoked from within
  43. "mytree walk root {a n} {
  44. if {[string equal $n "b"]} {
  45. lappend t .
  46. error fubar
  47. }
  48. lappend t $a $n
  49. }"
  50. (procedure "foo" line 7)
  51. invoked from within
  52. "foo"}
  53. ---- Result should have been (exact matching):
  54. {== enter root enter 0 enter a .} fubar {fubar
  55. while executing
  56. "error fubar"
  57. invoked from within
  58. "if {[string equal $n "b"]} {
  59. lappend t .
  60. error fubar
  61. }"
  62. ("WalkCall" body line 2)
  63. invoked from within
  64. "WalkCall $avar $nvar $name $node "enter" $script"
  65. (procedure "::struct::tree::_walk" line 88)
  66. invoked from within
  67. "::struct::tree::_walk ::mytree root {a n} {
  68. if {[string equal $n "b"]} {
  69. lappend t .
  70. error fubar
  71. }
  72. lappend t $a $n
  73. }"
  74. ("_walk" body line 1)
  75. invoked from within
  76. "mytree walk root {a n} {
  77. if {[string equal $n "b"]} {
  78. lappend t .
  79. error fubar
  80. }
  81. lappend t $a $n
  82. }"
  83. (procedure "foo" line 7)
  84. invoked from within
  85. "foo"}
  86. ==== tree-tcl-4.4.17 FAILED