Diff
Not logged in

Differences From Artifact [148512d340]:

To Artifact [81ae933dc8]:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# 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.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# SCCS: @(#) trace.test 1.27 97/07/23 17:08:38

if {[string compare test [info procs test]] == 1} then {source defs}

proc traceScalar {name1 name2 op} {
    global info
    set info [list $name1 $name2 $op [catch {uplevel set $name1} msg] $msg]
}












|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# 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.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# SCCS: @(#) trace.test 1.29 97/12/08 15:04:36

if {[string compare test [info procs test]] == 1} then {source defs}

proc traceScalar {name1 name2 op} {
    global info
    set info [list $name1 $name2 $op [catch {uplevel set $name1} msg] $msg]
}
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
    set info
} {5 1}

# Check operation and syntax of "trace" command.

test trace-13.1 {trace command (overall)} {
    list [catch {trace} msg] $msg
} {1 {too few args: should be "trace option [arg arg ...]"}}
test trace-13.2 {trace command (overall)} {
    list [catch {trace gorp} msg] $msg
} {1 {bad option "gorp": should be variable, vdelete, or vinfo}}
test trace-13.3 {trace command ("variable" option)} {
    list [catch {trace variable x y} msg] $msg
} {1 {wrong # args: should be "trace variable name ops command"}}
test trace-13.4 {trace command ("variable" option)} {
    list [catch {trace var x y z z2} msg] $msg
} {1 {wrong # args: should be "trace variable name ops command"}}
test trace-13.5 {trace command ("variable" option)} {







|


|







606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
    set info
} {5 1}

# Check operation and syntax of "trace" command.

test trace-13.1 {trace command (overall)} {
    list [catch {trace} msg] $msg
} {1 {wrong # args: should be "trace option [arg arg ...]"}}
test trace-13.2 {trace command (overall)} {
    list [catch {trace gorp} msg] $msg
} {1 {bad option "gorp": must be variable, vdelete, or vinfo}}
test trace-13.3 {trace command ("variable" option)} {
    list [catch {trace variable x y} msg] $msg
} {1 {wrong # args: should be "trace variable name ops command"}}
test trace-13.4 {trace command ("variable" option)} {
    list [catch {trace var x y z z2} msg] $msg
} {1 {wrong # args: should be "trace variable name ops command"}}
test trace-13.5 {trace command ("variable" option)} {
959
960
961
962
963
964
965
966
} {0 {a x y}}

# Delete arrays when done, so they can be re-used as scalars
# elsewhere.

catch {unset x}
catch {unset y}
concat {}







|
959
960
961
962
963
964
965
966
} {0 {a x y}}

# Delete arrays when done, so they can be re-used as scalars
# elsewhere.

catch {unset x}
catch {unset y}
return