summaryrefslogtreecommitdiffstats
path: root/tests/basic.test
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2003-06-25 23:02:10 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2003-06-25 23:02:10 (GMT)
commit43e3bcc7712f80d3c36696dbc1f9349f2819fe27 (patch)
tree9e458c1fda7815410cef063c83bd16dfb8e14927 /tests/basic.test
parentb2985d83d53d176dc990188526b12b93860253c7 (diff)
downloadtcl-43e3bcc7712f80d3c36696dbc1f9349f2819fe27.zip
tcl-43e3bcc7712f80d3c36696dbc1f9349f2819fe27.tar.gz
tcl-43e3bcc7712f80d3c36696dbc1f9349f2819fe27.tar.bz2
Factored out the trace code - it's big enough to be its own maintenance area
and tricky enough to discourage non-specialists...
Diffstat (limited to 'tests/basic.test')
-rw-r--r--tests/basic.test64
1 files changed, 2 insertions, 62 deletions
diff --git a/tests/basic.test b/tests/basic.test
index 0257ded..fac8dbf 100644
--- a/tests/basic.test
+++ b/tests/basic.test
@@ -15,21 +15,16 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: basic.test,v 1.27 2003/05/05 16:48:54 dkf Exp $
+# RCS: @(#) $Id: basic.test,v 1.28 2003/06/25 23:02:11 dkf Exp $
#
package require tcltest 2
namespace import -force ::tcltest::*
testConstraint testcmdtoken [llength [info commands testcmdtoken]]
-testConstraint testcmdtrace [llength [info commands testcmdtrace]]
testConstraint testcreatecommand [llength [info commands testcreatecommand]]
testConstraint exec [llength [info commands exec]]
-# This variable needs to be changed when the major or minor version number for
-# Tcl changes.
-set tclvers 8.5
-
catch {namespace delete test_ns_basic}
catch {interp delete test_interp}
catch {rename p ""}
@@ -483,62 +478,7 @@ test basic-37.1 {Tcl_ExprString: see expr.test} {emptyTest} {
test basic-38.1 {Tcl_ExprObj} {emptyTest} {
} {}
-test basic-39.1 {Tcl_CreateTrace, correct command and argc/argv arguments of trace proc} {testcmdtrace} {
- testcmdtrace tracetest {set stuff [expr 14 + 16]}
-} {{expr 14 + 16} {expr 14 + 16} {set stuff [expr 14 + 16]} {set stuff 30}}
-test basic-39.2 {Tcl_CreateTrace, correct command and argc/argv arguments of trace proc} {testcmdtrace} {
- testcmdtrace tracetest {set stuff [info tclversion]}
-} [list {info tclversion} {info tclversion} {set stuff [info tclversion]} "set stuff $tclvers"]
-test basic-39.3 {Tcl_CreateTrace, correct command and argc/argv arguments of trace proc} {testcmdtrace} {
- testcmdtrace deletetest {set stuff [info tclversion]}
-} $tclvers
-test basic-39.4 {Tcl_CreateTrace, check that tracing doesn't cause memory faults} {testcmdtrace} {
- # Note that the proc call is the same as the variable name, and that
- # the call can be direct or indirect by way of another procedure
- proc tracer {args} {}
- proc tracedLoop {level} {
- incr level
- tracer
- foreach tracer [expr {$level==1 ? {1 2} : {}}] {tracedLoop $level}
- }
- testcmdtrace tracetest {tracedLoop 0}
-} {{tracedLoop 0} {tracedLoop 0} {incr level} {incr level} tracer {tracer} {expr {$level==1 ? {1 2} : {}}} {expr {$level==1 ? {1 2} : {}}} {foreach tracer [expr {$level==1 ? {1 2} : {}}] {tracedLoop $level}} {foreach tracer {1 2} {tracedLoop $level}} {tracedLoop $level} {tracedLoop 1} {incr level} {incr level} tracer {tracer} {expr {$level==1 ? {1 2} : {}}} {expr {$level==1 ? {1 2} : {}}} {foreach tracer [expr {$level==1 ? {1 2} : {}}] {tracedLoop $level}} {foreach tracer {} {tracedLoop $level}} {tracedLoop $level} {tracedLoop 1} {incr level} {incr level} tracer {tracer} {expr {$level==1 ? {1 2} : {}}} {expr {$level==1 ? {1 2} : {}}} {foreach tracer [expr {$level==1 ? {1 2} : {}}] {tracedLoop $level}} {foreach tracer {} {tracedLoop $level}}}
-catch {rename tracer {}}
-catch {rename tracedLoop {}}
-
-test basic-39.5 {Tcl_CreateObjTrace, status return TCL_ERROR} {testcmdtrace} {
- proc Error { args } { error "Shouldn't get here" }
- set x 1;
- list [catch {testcmdtrace resulttest {Error $x}} result] [set result]
-} {1 {Error $x}}
-
-test basic-39.6 {Tcl_CreateObjTrace, status return TCL_RETURN} {testcmdtrace} {
- proc Return { args } { error "Shouldn't get here" }
- set x 1;
- list [catch {testcmdtrace resulttest {Return $x}} result] [set result]
-} {2 {}}
-
-test basic-39.7 {Tcl_CreateObjTrace, status return TCL_BREAK} {testcmdtrace} {
- proc Break { args } { error "Shouldn't get here" }
- set x 1;
- list [catch {testcmdtrace resulttest {Break $x}} result] [set result]
-} {3 {}}
-
-test basic-39.8 {Tcl_CreateObjTrace, status return TCL_CONTINUE} {testcmdtrace} {
- proc Continue { args } { error "Shouldn't get here" }
- set x 1;
- list [catch {testcmdtrace resulttest {Continue $x}} result] [set result]
-} {4 {}}
-
-test basic-39.9 {Tcl_CreateObjTrace, status return unknown} {testcmdtrace} {
- proc OtherStatus { args } { error "Shouldn't get here" }
- set x 1;
- list [catch {testcmdtrace resulttest {OtherStatus $x}} result] [set result]
-} {6 {}}
-
-test basic-40.1 {Tcl_DeleteTrace} {emptyTest} {
- # the above tests have tested Tcl_DeleteTrace
-} {}
+# Tests basic-39.* and basic-40.* refactored into trace.test
test basic-41.1 {Tcl_AddErrorInfo} {emptyTest} {
} {}