Attachment "CATCH.patch" to
ticket [526404ffff]
added by
msofer
2002-03-06 21:37:32.
Index: tcl/catch.bench
===================================================================
RCS file: /cvsroot/tcllib/tclbench/tcl/catch.bench,v
retrieving revision 1.2
diff -u -r1.2 catch.bench
--- tcl/catch.bench 1 Jun 2000 02:23:02 -0000 1.2
+++ tcl/catch.bench 6 Mar 2002 14:01:30 -0000
@@ -14,6 +14,24 @@
set a 0
}
+# catch with error condition, complex body with many nested ranges
+set nestedRanges {set a 0; while {$a} {nestedRanges}}
+for {set i 0} {$i < 3} {incr i} {
+ set nestedRanges [string map "nestedRanges \{$nestedRanges\}" $nestedRanges]
+}
+for {set i 0} {$i < 4} {incr i} {
+ append nestedRanges "\n$nestedRanges"
+}
+set body "
+ catch {set b}
+ set a 0
+ set b 0
+ $nestedRanges
+"
+proc catch-ranges {a} $body
+
+
bench -body {catch-error arg} -desc "CATCH return ok"
bench -body {catch-ok arg} -desc "CATCH return error"
bench -body {catch-none arg} -desc "CATCH no catch used"
+bench -body {catch-ranges arg} -desc "CATCH error, complex"