Tcl Source Code

Check-in [955414971d]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Minor tweaks to get these pages through the HTML converter
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | core-8-2-0 | scriptics-tclpro-1-3-0
Files: files | file ages | folders
SHA1: 955414971dddf0f991453bbf086b4fd7d4e00f92
User & Date: welch 1999-08-13 19:01:04
Context
1999-09-22
04:12
1999-09-21 Jeff Hobbs <[email protected]>
* tests/env.test: * unix/Makefile.in: added support...
check-in: ab656050a9 user: hobbs tags: core-8-2-1-branch
1999-08-15
04:03
Typo in comment check-in: 5af29d3264 user: jingham tags: trunk
1999-08-13
19:01
Minor tweaks to get these pages through the HTML converter check-in: 955414971d user: welch tags: trunk, core-8-2-0, scriptics-tclpro-1-3-0
19:00
Updated to handle more special backslash sequences found in re_syntax.n check-in: 7bc8c1e80d user: welch tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to doc/GetIndex.3.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
..
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
'\"
'\" Copyright (c) 1997 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" 
'\" RCS: @(#) $Id: GetIndex.3,v 1.4 1999/06/28 23:49:31 redman Exp $
'\" 
.so man.macros
.TH Tcl_GetIndexFromObj 3 8.1 Tcl "Tcl Library Procedures"
.BS
.SH NAME
Tcl_GetIndexFromObj \- lookup string in table of keywords
.SH SYNOPSIS
................................................................................
the table and the index of the matching entry.  If \fBTcl_GetIndexFromObj\fR
is invoked again with the same \fIobjPtr\fR and \fItablePtr\fR
arguments (e.g. during a reinvocation of a Tcl command), it returns
the matching index immediately without having to redo the lookup
operation.  Note: \fBTcl_GetIndexFromObj\fR assumes that the entries
in \fItablePtr\fR are static: they must not change between
invocations.  If the value of \fIobjPtr\fR is the empty string,
\fTcl_GetIndexFromObj\fR will treat it as a non-matching value
and return TCL_ERROR.
.VS
.PP
\fBTcl_GetIndexFromObjStruct\fR works just like
\fBTcl_GetIndexFromObj\fR, except that instead of treating
\fItablePtr\fR as an array of string pointers, it treats it as the
first in a series of string ptrs that are spaced apart by \fIoffset\fR





|







 







|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
..
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
'\"
'\" Copyright (c) 1997 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" 
'\" RCS: @(#) $Id: GetIndex.3,v 1.5 1999/08/13 19:01:04 welch Exp $
'\" 
.so man.macros
.TH Tcl_GetIndexFromObj 3 8.1 Tcl "Tcl Library Procedures"
.BS
.SH NAME
Tcl_GetIndexFromObj \- lookup string in table of keywords
.SH SYNOPSIS
................................................................................
the table and the index of the matching entry.  If \fBTcl_GetIndexFromObj\fR
is invoked again with the same \fIobjPtr\fR and \fItablePtr\fR
arguments (e.g. during a reinvocation of a Tcl command), it returns
the matching index immediately without having to redo the lookup
operation.  Note: \fBTcl_GetIndexFromObj\fR assumes that the entries
in \fItablePtr\fR are static: they must not change between
invocations.  If the value of \fIobjPtr\fR is the empty string,
\fBTcl_GetIndexFromObj\fR will treat it as a non-matching value
and return TCL_ERROR.
.VS
.PP
\fBTcl_GetIndexFromObjStruct\fR works just like
\fBTcl_GetIndexFromObj\fR, except that instead of treating
\fItablePtr\fR as an array of string pointers, it treats it as the
first in a series of string ptrs that are spaced apart by \fIoffset\fR

Changes to doc/catch.n.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
..
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
'\"
'\" Copyright (c) 1993-1994 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" 
'\" RCS: @(#) $Id: catch.n,v 1.3 1999/04/16 00:46:34 stanton Exp $
'\" 
.so man.macros
.TH catch n "8.0" Tcl "Tcl Built-In Commands"
.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
catch \- Evaluate script and trap exceptional returns
................................................................................
error. 

.SH EXAMPLES

The \fBcatch\fR command may be used in an \fBif\fR to branch based on
the success of a script.

.DS
.CS
if { [catch {open $someFile w} fid] } {
    puts stderr "Could not open $someFile for writing\\n$fid"
    exit 1
}
.CE
.DE
The \fBcatch\fR command will not catch compiled syntax errors.  The
first time proc \fBfoo\fR is called, the body will be compiled and a
Tcl error will be generated. 

.DS
.CS
proc foo {} {
    catch {expr {1 +- }}
}
.CE
.DE

.SH KEYWORDS
catch, error






|







 







<






<




<





<



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
..
42
43
44
45
46
47
48

49
50
51
52
53
54

55
56
57
58

59
60
61
62
63

64
65
66
'\"
'\" Copyright (c) 1993-1994 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" 
'\" RCS: @(#) $Id: catch.n,v 1.4 1999/08/13 19:01:04 welch Exp $
'\" 
.so man.macros
.TH catch n "8.0" Tcl "Tcl Built-In Commands"
.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
catch \- Evaluate script and trap exceptional returns
................................................................................
error. 

.SH EXAMPLES

The \fBcatch\fR command may be used in an \fBif\fR to branch based on
the success of a script.


.CS
if { [catch {open $someFile w} fid] } {
    puts stderr "Could not open $someFile for writing\\n$fid"
    exit 1
}
.CE

The \fBcatch\fR command will not catch compiled syntax errors.  The
first time proc \fBfoo\fR is called, the body will be compiled and a
Tcl error will be generated. 


.CS
proc foo {} {
    catch {expr {1 +- }}
}
.CE


.SH KEYWORDS
catch, error

Changes to doc/tcltest.n.

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
..
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
..
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
...
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
'\" Copyright (c) 1990-1994 The Regents of the University of California
'\" Copyright (c) 1994-1997 Sun Microsystems, Inc.
'\" Copyright (c) 1998-1999 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: tcltest.n,v 1.4 1999/07/26 22:50:53 jenn Exp $
'\" 
.so man.macros
.TH "Tcltest" n 8.2 Tcl "Tcl Built-In Commands"
.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
Tcltest \- Test harness support code and utilities
................................................................................
.SH SYNOPSIS
\fBpackage require tcltest ?1.0?\fP
.sp
\fB::tcltest::test \fIname desc ?constraint? script expectedAnswer\fR
.sp
\fB::tcltest::cleanupTests \fI?runningMultipleTests?\fR
.sp
\fB::tcltest::getMatchingTestFiles
.sp
\fB::tcltest::makeFile \fIcontents name\fR
.sp
\fB::tcltest::removeFile \fIname\fR
.sp
\fB::tcltest::makeDirectory \fIname\fR
.sp
................................................................................
.sp
\fB::tcltest::viewFile \fIname\fR
.sp
\fB::tcltest::normalizeMsg \fImsg\fR
.sp
\fB::tcltest::bytestring \fIstring\fR
.sp
\fB::tcltest::saveState
.sp
\fB::tcltest::restoreState
.sp
\fB::tcltest::threadReap
.BE
.SH DESCRIPTION
.PP
The \fBtcltest\fR package provides the user with utility tools for
writing and running tests in the Tcl test suite.  It can also be used
to create a customized test harness for an extension. 
.PP
................................................................................
.TP
\fB::tcltest::PrintUsageInfoHook\fP
print additional usage information specific to your situation.
.TP
\fB::tcltest::processCmdLineArgsFlagHook\fP
tell the test harness about additional flags that you want it to understand.
.TP
\fB::tcltest::processCmdLineArgsHook\fR flags\fP
process the additional flags that you told the harness about in
::tcltest::processCmdLineArgsFlagHook.
.TP
\fB::tcltest::initConstraintsHook\fP
used to add additional built-in constraints to those already defined
by \fBtcltest\fR.  
.TP






|







 







|







 







|

|

|







 







|







2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
..
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
..
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
...
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
'\" Copyright (c) 1990-1994 The Regents of the University of California
'\" Copyright (c) 1994-1997 Sun Microsystems, Inc.
'\" Copyright (c) 1998-1999 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: tcltest.n,v 1.5 1999/08/13 19:01:05 welch Exp $
'\" 
.so man.macros
.TH "Tcltest" n 8.2 Tcl "Tcl Built-In Commands"
.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
Tcltest \- Test harness support code and utilities
................................................................................
.SH SYNOPSIS
\fBpackage require tcltest ?1.0?\fP
.sp
\fB::tcltest::test \fIname desc ?constraint? script expectedAnswer\fR
.sp
\fB::tcltest::cleanupTests \fI?runningMultipleTests?\fR
.sp
\fB::tcltest::getMatchingTestFiles\fR
.sp
\fB::tcltest::makeFile \fIcontents name\fR
.sp
\fB::tcltest::removeFile \fIname\fR
.sp
\fB::tcltest::makeDirectory \fIname\fR
.sp
................................................................................
.sp
\fB::tcltest::viewFile \fIname\fR
.sp
\fB::tcltest::normalizeMsg \fImsg\fR
.sp
\fB::tcltest::bytestring \fIstring\fR
.sp
\fB::tcltest::saveState\fR
.sp
\fB::tcltest::restoreState\fR
.sp
\fB::tcltest::threadReap\fR
.BE
.SH DESCRIPTION
.PP
The \fBtcltest\fR package provides the user with utility tools for
writing and running tests in the Tcl test suite.  It can also be used
to create a customized test harness for an extension. 
.PP
................................................................................
.TP
\fB::tcltest::PrintUsageInfoHook\fP
print additional usage information specific to your situation.
.TP
\fB::tcltest::processCmdLineArgsFlagHook\fP
tell the test harness about additional flags that you want it to understand.
.TP
\fB::tcltest::processCmdLineArgsHook\fR \fIflags\fP
process the additional flags that you told the harness about in
::tcltest::processCmdLineArgsFlagHook.
.TP
\fB::tcltest::initConstraintsHook\fP
used to add additional built-in constraints to those already defined
by \fBtcltest\fR.  
.TP