1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
-
+
|
# Commands covered: trace
#
# This file contains a collection of tests for one or more of the Tcl
# built-in commands. Sourcing this file into Tcl runs the tests and
# generates output for errors. No output means no errors were found.
#
# Copyright (c) 1991-1993 The Regents of the University of California.
# Copyright (c) 1994 Sun Microsystems, Inc.
# Copyright (c) 1998-1999 by Scriptics Corporation.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# RCS: @(#) $Id: trace.test,v 1.56 2007/06/27 18:21:52 dgp Exp $
# RCS: @(#) $Id: trace.test,v 1.57 2007/08/09 12:20:08 msofer Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
namespace import -force ::tcltest::*
}
testConstraint testcmdtrace [llength [info commands testcmdtrace]]
|
227
228
229
230
231
232
233
234
235
236
237
238
239
240
|
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
catch {unset x}
set x 1234
set info {}
trace add variable x write traceScalar
unset x
set info
} {}
test trace-2.6 {trace variable writes on compiled local} {
#
# Check correct function of whole array traces on compiled local
# arrays [Bug 1770591]. The corresponding function for read traces is
# already indirectly tested in trace-1.7
#
catch {unset x}
set info {}
proc p {} {
trace add variable x write traceArray
set x(X) willy
}
p
set info
} {x X write 0 willy}
# append no longer triggers read traces when fetching the old values of
# variables before doing the append operation. However, lappend _does_
# still trigger these read traces. Also lappend triggers only one write
# trace: after appending all arguments to the list.
test trace-3.1 {trace variable read-modify-writes} {
|