diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/apply.n | 3 | ||||
-rw-r--r-- | doc/binary.n | 11 | ||||
-rw-r--r-- | doc/chan.n | 23 | ||||
-rw-r--r-- | doc/clock.n | 196 | ||||
-rw-r--r-- | doc/concat.n | 20 | ||||
-rw-r--r-- | doc/dde.n | 10 | ||||
-rw-r--r-- | doc/encoding.n | 7 | ||||
-rw-r--r-- | doc/exec.n | 9 | ||||
-rw-r--r-- | doc/fcopy.n | 25 | ||||
-rw-r--r-- | doc/file.n | 59 | ||||
-rw-r--r-- | doc/filename.n | 51 | ||||
-rw-r--r-- | doc/format.n | 7 | ||||
-rw-r--r-- | doc/info.n | 22 | ||||
-rw-r--r-- | doc/mathfunc.n | 59 | ||||
-rw-r--r-- | doc/mathop.n | 7 | ||||
-rw-r--r-- | doc/memory.n | 30 | ||||
-rw-r--r-- | doc/regexp.n | 4 | ||||
-rw-r--r-- | doc/registry.n | 7 | ||||
-rw-r--r-- | doc/source.n | 8 | ||||
-rw-r--r-- | doc/string.n | 21 | ||||
-rw-r--r-- | doc/tcltest.n | 427 | ||||
-rw-r--r-- | doc/tm.n | 8 | ||||
-rw-r--r-- | doc/trace.n | 14 |
23 files changed, 603 insertions, 425 deletions
diff --git a/doc/apply.n b/doc/apply.n index 22b068d..8b5b3ee 100644 --- a/doc/apply.n +++ b/doc/apply.n @@ -41,7 +41,8 @@ The invocation of \fBapply\fR adds a call frame to Tcl's evaluation stack proceeds in this call frame, in the namespace given by \fInamespace\fR or in the global namespace if none was specified. If given, \fInamespace\fR is interpreted relative to the global namespace even if its name does not start -with '::'. +with +.QW :: . .PP The semantics of \fBapply\fR can also be described by: .PP diff --git a/doc/binary.n b/doc/binary.n index f6598a4..e98917b 100644 --- a/doc/binary.n +++ b/doc/binary.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: binary.n,v 1.30 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: binary.n,v 1.31 2007/10/25 14:07:32 dkf Exp $ '\" .so man.macros .TH binary n 8.0 Tcl "Tcl Built-In Commands" @@ -396,7 +396,8 @@ position to satisfy the current field specifier, then the corresponding variable is left untouched and \fBbinary scan\fR returns immediately with the number of variables that were set. If there are not enough arguments for all of the fields in the format string that -consume arguments, then an error is generated. The flag character 'u' +consume arguments, then an error is generated. The flag character +.QW u may be given to cause some types to be read as unsigned values. The flag is accepted for all field types but is ignored for non-integer fields. .PP @@ -435,8 +436,10 @@ will be sign extended. Thus the following will occur: set signShort [\fBbinary format\fR s1 0x8000] \fBbinary scan\fR $signShort s1 val; \fI# val == 0xFFFF8000\fR .CE -If you require unsigned values you can include the 'u' flag character following -the field type. For example, to read an unsigned short value: +If you require unsigned values you can include the +.QW u +flag character following the field type. For example, to read an +unsigned short value: .CS set signShort [\fBbinary format\fR s1 0x8000] \fBbinary scan\fR $signShort su1 val; \fI# val == 0x00008000\fR @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: chan.n,v 1.11 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: chan.n,v 1.12 2007/10/25 14:07:32 dkf Exp $ .so man.macros .TH chan n 8.5 Tcl "Tcl Built-In Commands" .BS @@ -293,7 +293,9 @@ Note that \fIinputChan\fR can become readable during a background copy. You should turn off any \fBchan event\fR or \fBfileevent\fR handlers during a background copy so those handlers do not interfere with the copy. Any I/O attempted by a \fBchan event\fR or -\fBfileevent\fR handler will get a "channel busy" error. +\fBfileevent\fR handler will get a +.QW "channel busy" +error. .PP \fBChan copy\fR translates end-of-line sequences in \fIinputChan\fR and \fIoutputChan\fR according to the \fB\-translation\fR option for @@ -333,7 +335,11 @@ the channel. .PP The argument \fImode\fR specifies if the new channel is opened for reading, writing, or both. It has to be a list containing any of the -strings "\fBread\fR" or "\fBwrite\fR". The list must have at least one +strings +.QW "\fBread\fR" +or +.QW "\fBwrite\fR" . +The list must have at least one element, as a channel you can neither write to nor read from makes no sense. The handler command for the new channel must support the chosen mode, or an error is thrown. @@ -498,7 +504,11 @@ only those channel names that match it (according to the rules of .TP \fBchan pending \fImode channelId\fR . -Depending on whether \fImode\fR is "input" or "output", returns the number of +Depending on whether \fImode\fR is +.QW "input" +or +.QW "output" , +returns the number of bytes of input or output (respectively) currently buffered internally for \fIchannelId\fR (especially useful in a readable event callback to impose application-specific limits on input line lengths to avoid @@ -512,7 +522,10 @@ This subcommand is used by command handlers specified with \fBchan create\fR. It notifies the channel represented by the handle \fIchannelId\fR that the event(s) listed in the \fIeventSpec\fR have occurred. The argument has to be a list containing any of the strings -"\fBread\fR" and "\fBwrite\fR". The list must contain at least one +.QW "\fBread\fR" +and +.QW "\fBwrite\fR" . +The list must contain at least one element as it does not make sense to invoke the command if there are no events to post. .RS diff --git a/doc/clock.n b/doc/clock.n index 0f85a7d..46a3528 100644 --- a/doc/clock.n +++ b/doc/clock.n @@ -10,17 +10,17 @@ clock \- Obtain and manipulate dates and times .SH "SYNOPSIS" package require \fBTcl 8.5\fR .sp -\fBclock add\fR \fItimeVal\fR ?\fIcount unit...\fR? ?\fI-option value\fR? +\fBclock add\fR \fItimeVal\fR ?\fIcount unit...\fR? ?\fI\-option value\fR? .sp -\fBclock clicks\fR ?\fI-option\fR? +\fBclock clicks\fR ?\fI\-option\fR? .sp -\fBclock format\fR \fItimeVal\fR ?\fI-option value\fR...? +\fBclock format\fR \fItimeVal\fR ?\fI\-option value\fR...? .sp \fBclock microseconds\fR .sp \fBclock milliseconds\fR .sp -\fBclock scan\fR \fIinputString\fR ?\fI-option value\fR...? +\fBclock scan\fR \fIinputString\fR ?\fI\-option value\fR...? .sp \fBclock seconds\fR .sp @@ -31,27 +31,27 @@ The \fBclock\fR command performs several operations that obtain and manipulate values that represent times. The command supports several subcommands that determine what action is carried out by the command. .TP -\fBclock add\fR \fItimeVal\fR ?\fIcount unit...\fR? ?\fI-option value\fR? +\fBclock add\fR \fItimeVal\fR ?\fIcount unit...\fR? ?\fI\-option value\fR? Adds a (possibly negative) offset to a time that is expressed as an integer number of seconds. See \fBCLOCK ARITHMETIC\fR for a full description. .TP -\fBclock clicks\fR ?\fI-option\fR? -If no \fI-option\fR argument is supplied, returns a high-resolution +\fBclock clicks\fR ?\fI\-option\fR? +If no \fI\-option\fR argument is supplied, returns a high-resolution time value as a system-dependent integer value. The unit of the value is system-dependent but should be the highest resolution clock available on the system such as a CPU cycle counter. See \fBHIGH RESOLUTION TIMERS\fR for a full description. .sp -If the \fI-option\fR argument is \fI-milliseconds\fR, then the command +If the \fI\-option\fR argument is \fI\-milliseconds\fR, then the command is synonymous with \fBclock milliseconds\fR (see below). This usage is obsolete, and \fBclock milliseconds\fR is to be considered the preferred way of obtaining a count of milliseconds. .sp -If the \fI-option\fR argument is \fI-microseconds\fR, then the command +If the \fI\-option\fR argument is \fI\-microseconds\fR, then the command is synonymous with \fBclock microseconds\fR (see below). This usage is obsolete, and \fBclock microseconds\fR is to be considered the preferred way of obtaining a count of microseconds. .TP -\fBclock format\fR \fItimeVal\fR ?\fI-option value\fR...? +\fBclock format\fR \fItimeVal\fR ?\fI\-option value\fR...? Formats a time that is expressed as an integer number of seconds into a format intended for consumption by users or external programs. See \fBFORMATTING TIMES\fR for a full description. @@ -62,7 +62,7 @@ Returns the current time as an integer number of microseconds. See \fBHIGH RESO \fBclock milliseconds\fR Returns the current time as an integer number of milliseconds. See \fBHIGH RESOLUTION TIMERS\fR for a full description. .TP -\fBclock scan\fR \fIinputString\fR ?\fI-option value\fR...? +\fBclock scan\fR \fIinputString\fR ?\fI\-option value\fR...? Scans a time that is expressed as a character string and produces an integer number of seconds. See \fBSCANNING TIMES\fR for a full description. @@ -93,15 +93,16 @@ to identify an interval of time, for example, \fI3 seconds\fR or \fI1 year\fR. .SS "OPTIONS" .TP -\fB-base\fR time +\fB\-base\fR time Specifies that any relative times present in a \fBclock scan\fR command are to be given relative to \fItime\fR. \fItime\fR must be expressed as a count of nominal seconds from the epoch time of 1 January 1970, 00:00 UTC. .TP -\fB-format\fR format +\fB\-format\fR format Specifies the desired output format for \fBclock format\fR or the expected input format for \fBclock scan\fR. The \fIformat\fR string consists -of any number of characters other than the per-cent sign ('\fI%\fR') +of any number of characters other than the per-cent sign +.PQ \fI%\fR interspersed with any number of \fIformat groups\fR, which are two-character sequences beginning with the per-cent sign. The permissible format groups, and their interpretation, are described under \fBFORMAT GROUPS\fR. @@ -112,20 +113,21 @@ On \fBclock format\fR, the default format is %a %b %d %H:%M:%S %z %Y .CE .PP -On \fBclock scan\fR, the lack of a \fI-format\fR option indicates that -a "free format scan" is requested; see \fBFREE FORM SCAN\fR for a -description of what happens. +On \fBclock scan\fR, the lack of a \fI\-format\fR option indicates that a +.QW "free format scan" +is requested; see \fBFREE FORM SCAN\fR for a description of what happens. .RE .TP -\fB-gmt\fR boolean +\fB\-gmt\fR boolean If \fIboolean\fR is true, specifies that a time specified to \fBclock add\fR, \fBclock format\fR or \fBclock scan\fR should be processed in UTC. If \fIboolean\fR is false, the processing defaults to the local time zone. This usage is obsolete; the correct current usage is to -specify the UTC time zone with '\fB-timezone\fR \fI:UTC\fR' or any of -the equivalent ways to specify it. +specify the UTC time zone with +.QW "\fB\-timezone\fR \fI:UTC\fR" +or any of the equivalent ways to specify it. .TP -\fB-locale\fR localeName +\fB\-locale\fR localeName Specifies that locale-dependent scanning and formatting (and date arithmetic for dates preceding the adoption of the Gregorian calendar) is to be done in the locale identified by \fIlocaleName\fR. The locale name may be any of @@ -138,12 +140,12 @@ descriptions of the individual format groups under \fBFORMAT GROUPS\fR. The effect of locale on clock arithmetic is discussed under \fBCLOCK ARITHMETIC\fR. .TP -\fB-timezone\fR zoneName +\fB\-timezone\fR zoneName Specifies that clock arithmetic, formatting, and scanning are to be done according to the rules for the time zone specified by \fIzoneName\fR. The permissible values, and their interpretation, are discussed under \fBTIME ZONES\fR. -On subcommands that expect a \fB-timezone\fR argument, the default +On subcommands that expect a \fB\-timezone\fR argument, the default is to use the \fIcurrent time zone\fR. The current time zone is determined, in order of preference, by: .RS @@ -163,7 +165,7 @@ years 1902 to 2037) that can be represented in a 32-bit integer. The \fBclock add\fR command performs clock arithmetic on a value (expressed as nominal seconds from the epoch time of 1 January 1970, 00:00 UTC) given as its first argument. The remaining arguments (other than the -possible \fB-timezone\fR, \fB-locale\fR and \fB-gmt\fR options) +possible \fB\-timezone\fR, \fB\-locale\fR and \fB\-gmt\fR options) are integers and keywords in alternation, where the keywords are chosen from \fBseconds\fR, \fBminutes\fR, \fBhours\fR, \fBdays\fR, \fBweeks\fR, \fBmonths\fR, or \fByears\fR, or @@ -284,70 +286,84 @@ expressed in seconds from the epoch time of 1 January 1970, 00:00 UTC, as returned by \fBclock seconds\fR, \fBclock scan\fR, \fBclock add\fR, \fBfile atime\fR or \fBfile mtime\fR. .PP -If a \fB-format\fR option is present, the following argument is +If a \fB\-format\fR option is present, the following argument is a string that specifies how the date and time are to be formatted. The string consists -of any number of characters other than the per-cent sign ('\fI%\fR') +of any number of characters other than the per-cent sign +.PQ \fI%\fR interspersed with any number of \fIformat groups\fR, which are two-character sequences beginning with the per-cent sign. The permissible format groups, and their interpretation, are described under \fBFORMAT GROUPS\fR. .PP -If a \fB-timezone\fR option is present, the following +If a \fB\-timezone\fR option is present, the following argument is a string that specifies the time zone in which the date and time -are to be formatted. As an alternative to \fB-timezone\fR \fI:UTC\fR, -the obsolete usage \fB-gmt\fR \fItrue\fR may be used. See -\fBTIME ZONES\fR for the permissible variants for the time zone. -.PP -If a \fB-locale\fR option is present, the following argument is +are to be formatted. As an alternative to +.QW "\fB\-timezone\fR \fI:UTC\fR" , +the obsolete usage +.QW "\fB\-gmt\fR \fItrue\fR" +may be used. See \fBTIME ZONES\fR for the permissible variants for the time +zone. +.PP +If a \fB\-locale\fR option is present, the following argument is a string that specifies the locale in which the time is to be formatted, in the same format that is used for the \fBmsgcat\fR package. Note -that the default, if \fB-locale\fR is not specified, is the root locale +that the default, if \fB\-locale\fR is not specified, is the root locale \fB{}\fR rather than the current locale. The current locale may -be obtained by using \fB-locale\fR \fBcurrent\fR. +be obtained by using +.QW "\fB\-locale\fR \fBcurrent\fR" . In addition, some platforms support a \fBsystem\fR locale that reflects the user's current choices. For instance, on Windows, the format that the user has selected from dates and times in the Control Panel can be obtained by using the \fBsystem\fR locale. On platforms that do not define a user selection of date and time formats -separate from \fBLC_TIME\fR, \fB-locale\fR \fBsystem\fR is -synonymous with \fB-locale\fR \fBcurrent\fR. +separate from \fBLC_TIME\fR, +.QW "\fB\-locale\fR \fBsystem\fR" +is synonymous with +.QW "\fB\-locale\fR \fBcurrent\fR" . .SH "SCANNING TIMES" The \fBclock scan\fR command accepts times that are formatted as strings and converts them to counts of seconds from the epoch time -of 1 January 1970, 00:00 UTC. It normally takes a \fB-format\fR +of 1 January 1970, 00:00 UTC. It normally takes a \fB\-format\fR option that is followed by a string describing the expected format of the input. (See \fBFREE FORM SCAN\fR for the effect of \fBclock scan\fR without such an argument.) The string consists of any number of -characters other than the per-cent sign ('\fI%\fR'), +characters other than the per-cent sign +.PQ \fI%\fR "" , interspersed with any number of \fIformat groups\fR, which are two-character sequences beginning with the per-cent sign. The permissible format groups, and their interpretation, are described under \fBFORMAT GROUPS\fR. .PP -If a \fB-timezone\fR option is present, the following +If a \fB\-timezone\fR option is present, the following argument is a string that specifies the time zone in which the date and time -are to be interpreted. As an alternative to \fB-timezone\fR \fI:UTC\fR, -the obsolete usage \fB-gmt\fR \fItrue\fR may be used. See -\fBTIME ZONES\fR for the permissible variants for the time zone. -.PP -If a \fB-locale\fR option is present, the following argument is +are to be interpreted. As an alternative to +.QW "\fB\-timezone\fR \fI:UTC\fR" , +the obsolete usage +.QW "\fB\-gmt\fR \fItrue\fR" +may be used. See \fBTIME ZONES\fR for the permissible variants for the time +zone. +.PP +If a \fB\-locale\fR option is present, the following argument is a string that specifies the locale in which the time is to be interpreted, in the same format that is used for the \fBmsgcat\fR package. Note -that the default, if \fB-locale\fR is not specified, is the root locale -\fB{}\fR rather than the current locale. The current locale may -be obtained by using \fB-locale\fR \fBcurrent\fR. +that the default, if \fB\-locale\fR is not specified, is the root locale +.MT +rather than the current locale. The current locale may be obtained by using +.QW "\fB\-locale\fR \fBcurrent\fR" . In addition, some platforms support a \fBsystem\fR locale that reflects the user's current choices. For instance, on Windows, the format that the user has selected from dates and times in the Control Panel can be obtained by using the \fBsystem\fR locale. On platforms that do not define a user selection of date and time formats -separate from \fBLC_TIME\fR, \fB-locale\fR \fBsystem\fR is -synonymous with \fB-locale\fR \fBcurrent\fR. +separate from \fBLC_TIME\fR, +.QW "\fB\-locale\fR \fBsystem\fR" +is synonymous with +.QW "\fB\-locale\fR \fBcurrent\fR" . .PP -If a \fB-base\fR option is present, the following argument is +If a \fB\-base\fR option is present, the following argument is a time (expressed in seconds from the epoch time) that is used as a \fIbase time\fR for interpreting relative times. If no -\fB-base\fR option is present, the base time is the current time. +\fB\-base\fR option is present, the base time is the current time. .PP Scanning of times in fixed format works by determining three things: the date, the time of day, and the time zone. These three are then @@ -422,7 +438,7 @@ combines with the hour and minute. If the string contains neither a \fB%s\fR format group nor a group specifying the hour of the day, then midnight (\fB00:00\fR, the start of the given date) is used. -The time zone is determined by either the \fB-timezone\fR or \fB-gmt\fR +The time zone is determined by either the \fB\-timezone\fR or \fB\-gmt\fR options, or by using the current time zone. .PP If a format string lacks a \fB%z\fR or \fB%Z\fR format group, @@ -587,10 +603,13 @@ and interprets them as the number of the month. .TP \fB%Od\fR, \fB%Oe\fR, \fB%OH\fR, \fB%OI\fR, \fB%Ok\fR, \fB%Ol\fR, \fB%Om\fR, \fB%OM\fR, \fB%OS\fR, \fB%Ou\fR, \fB%Ow\fR, \fB%Oy\fR All of these format groups are synonymous with their counterparts -without the '\fBO\fR', except that the string is produced and parsed in the -locale-dependent alternative numerals. +without the +.QW \fBO\fR , +except that the string is produced and parsed in the locale-dependent +alternative numerals. .TP \fB%p\fR +. On output, produces an indicator for the part of the day, \fBAM\fR or \fBPM\fR, appropriate to the given locale. If the script of the given locale supports multiple letterforms, lowercase is preferred. @@ -709,11 +728,15 @@ Brazilian Standard Time. It is recommended that date/time strings for use by computers use numeric time zones instead. .TP \fB%%\fR -On output, produces a literal '\fB%\fR' character. On input, matches -a literal '\fB%\fR' character. +On output, produces a literal +.QW \fB%\fR +character. On input, matches a literal +.QW \fB%\fR +character. .TP \fB%+\fR -Synonymous with '\fB%a %b %e %H:%M:%S %Z %Y\fR'. +Synonymous with +.QW "\fB%a %b %e %H:%M:%S %Z %Y\fR" . .SH "TIME ZONES" When the \fBclock\fR command is processing a local time, it has several possible sources for the time zone to use. In order of preference, they @@ -722,8 +745,9 @@ are: A time zone specified inside a string being parsed and matched by a \fB%z\fR or \fB%Z\fR format group. .IP [2] -A time zone specified with the \fB-timezone\fR option to the \fBclock\fR -command (or, equivalently, by \fB-gmt\fR \fB1\fR). +A time zone specified with the \fB\-timezone\fR option to the \fBclock\fR +command (or, equivalently, by +.QW "\fB\-gmt\fR \fB1\fR" ). .IP [3] A time zone specified in an environment variable \fBTCL_TZ\fR. .IP [4] @@ -759,10 +783,14 @@ that give the rules for various locales. A complete list of the location names is too lengthy to be listed here. On most Tcl installations, the definitions of the locations are to be found in named files in the directory - "\fI/no_backup/tools/lib/tcl8.5/clock/tzdata\fR". On some Unix systems, these +.QW "\fI/no_backup/tools/lib/tcl8.5/clock/tzdata\fR" . +On some Unix systems, these files are omitted, and the definitions are instead -obtained from system files in "\fI/usr/share/zoneinfo\fR", - "\fI/usr/share/lib/zoneinfo\fR" or "\fI/usr/local/etc/zoneinfo\fR". +obtained from system files in +.QW "\fI/usr/share/zoneinfo\fR" , +.QW "\fI/usr/share/lib/zoneinfo\fR" +or +.QW "\fI/usr/local/etc/zoneinfo\fR" . As a special case, the name \fB:localtime\fR refers to the local time zone as defined by the C library. .PP @@ -784,17 +812,18 @@ Developers wishing to localize the date and time formatting and parsing are referred to \fIhttp://tip.tcl.tk/173\fR for a specification. .SH "FREE FORM SCAN" -If the \fBclock scan\fR command is invoked without a \fB-format\fR +If the \fBclock scan\fR command is invoked without a \fB\-format\fR option, then it requests a \fIfree-form scan.\fR \fI This form of scan is deprecated.\fR The reason for the deprecation -is that there are too many ambiguities. (Does the string '2000' +is that there are too many ambiguities. (Does the string +.QW 2000 represent a year, a time of day, or a quantity?) No set of rules for interpreting free-form dates and times has been found to give unsurprising results in all cases. .PP -If free-form scan is used, only the \fB-base\fR and \fB-gmt\fR -options are accepted. The \fB-timezone\fR and \fB-locale\fR -options will result in an error if \fB-format\fR is not supplied. +If free-form scan is used, only the \fB\-base\fR and \fB\-gmt\fR +options are accepted. The \fB\-timezone\fR and \fB\-locale\fR +options will result in an error if \fB\-format\fR is not supplied. .PP For the benefit of users who need to understand legacy code that uses free-form scan, the documentation for how free-form scan @@ -803,13 +832,13 @@ interprets a string is included here: If only a time is specified, the current date is assumed. If the \fIinputString\fR does not contain a -time zone mnemonic, the local time zone is assumed, unless the \fB-gmt\fR +time zone mnemonic, the local time zone is assumed, unless the \fB\-gmt\fR argument is true, in which case the clock value is calculated assuming that the specified time is relative to Greenwich Mean Time. -\fB-gmt\fR, if specified, affects only the computed time value; it does not -impact the interpretation of \fB-base\fR. +\fB\-gmt\fR, if specified, affects only the computed time value; it does not +impact the interpretation of \fB\-base\fR. .PP -If the \fB-base\fR flag is specified, the next argument should contain +If the \fB\-base\fR flag is specified, the next argument should contain an integer clock value. Only the date in this value is used, not the time. This is useful for determining the time on a specific day or doing other date-relative conversions. @@ -824,13 +853,14 @@ If no meridian is specified, \fBhh\fR is interpreted on a 24-hour clock. .TP \fIdate\fR -A specific month and day with optional year. The -acceptable formats are "\fBmm/dd\fR?\fB/yy\fR?", - "\fBmonthname dd\fR?\fB, yy\fR?", - "\fBday, dd monthname \fR?\fByy\fR?", - "\fBdd monthname yy\fR", - "?\fBCC\fR?\fByymmdd\fR", and - "\fBdd-monthname-\fR?\fBCC\fR?\fByy\fR". +A specific month and day with optional year. The acceptable formats are +.QW "\fBmm/dd\fR?\fB/yy\fR?" , +.QW "\fBmonthname dd\fR?\fB, yy\fR?" , +.QW "\fBday, dd monthname \fR?\fByy\fR?" , +.QW "\fBdd monthname yy\fR" , +.QW "?\fBCC\fR?\fByymmdd\fR" , +and +.QW "\fBdd-monthname-\fR?\fBCC\fR?\fByy\fR" . The default year is the current year. If the year is less than 100, we treat the years 00-68 as 2000-2068 and the years 69-99 as 1969-1999. Not all platforms can represent the years 38-70, so @@ -838,11 +868,15 @@ an error may result if these years are used. .TP \fIISO 8601 point-in-time\fR An ISO 8601 point-in-time specification, such as \fBCCyymmddThhmmss\fR, -where \fBT\fR is the literal T, "\fBCCyymmdd hhmmss\fR", or -\fBCCyymmddThh:mm:ss\fR. Note that only these three formats are accepted. +where \fBT\fR is the literal +.QW T , +.QW "\fBCCyymmdd hhmmss\fR" , +or +.QW \fBCCyymmddThh:mm:ss\fR . +Note that only these three formats are accepted. The command does \fInot\fR accept the full range of point-in-time specifications specified in ISO8601. Other formats can be recognized by -giving an explicit \fI-format\fR option to the \fBclock scan\fR command. +giving an explicit \fI\-format\fR option to the \fBclock scan\fR command. .TP \fIrelative time\fR A specification relative to the current time. The format is \fBnumber diff --git a/doc/concat.n b/doc/concat.n index db7081f..dba0b39 100644 --- a/doc/concat.n +++ b/doc/concat.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: concat.n,v 1.7 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: concat.n,v 1.8 2007/10/25 14:07:32 dkf Exp $ '\" .so man.macros .TH concat n 8.3 Tcl "Tcl Built-In Commands" @@ -30,20 +30,30 @@ Although \fBconcat\fR will concatenate lists (so the command: .CS \fBconcat\fR a b {c d e} {f {g h}} .CE -will return "\fBa b c d e f {g h}\fR" as its result), it will also +will return +.QW "\fBa b c d e f {g h}\fR" +as its result), it will also concatenate things that are not lists, and hence the command: .CS \fBconcat\fR " a b {c " d " e} f" .CE -will return "\fBa b {c d e} f\fR" as its result. +will return +.QW "\fBa b {c d e} f\fR" +as its result. .PP Note that the concatenation does not remove spaces from the middle of its arguments, so the command: .CS \fBconcat\fR "a b c" { d e f } .CE -will return "\fBa b c d e f\fR" (i.e. with three spaces between -the \fBa\fR, the \fBb\fR and the \fBc\fR). +will return +.QW "\fBa b c d e f\fR" +(i.e. with three spaces between the +.QW \fBa\fR , +the +.QW \fBb\fR +and the +.QW \fBc\fR ). .SH "SEE ALSO" append(n), eval(n) .SH KEYWORDS @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: dde.n,v 1.18 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: dde.n,v 1.19 2007/10/25 14:07:32 dkf Exp $ '\" .so man.macros .TH dde n 1.3 dde "Tcl Bundled Packages" @@ -54,9 +54,13 @@ the service name \fBTclEval\fR and the topic name specified by \fItopic\fR. If no \fItopic\fR is given, \fBdde servername\fR returns the name of the current topic or the empty string if it is not registered as a service. If the given \fItopic\fR name is already in use, then a -suffix of the form ' #2' or ' #3' is appended to the name to make it +suffix of the form +.QW " #2" +or +.QW " #3" +is appended to the name to make it unique. The command's result will be the name actually used. The -\fB-force\fR option is used to force registration of precisely the +\fB\-force\fR option is used to force registration of precisely the given \fItopic\fR name. .IP The \fB-handler\fR option specifies a Tcl procedure that will be called to diff --git a/doc/encoding.n b/doc/encoding.n index 8dfa254..4524959 100644 --- a/doc/encoding.n +++ b/doc/encoding.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: encoding.n,v 1.9 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: encoding.n,v 1.10 2007/10/25 14:07:32 dkf Exp $ '\" .so man.macros .TH encoding n "8.1" Tcl "Tcl Built-In Commands" @@ -84,8 +84,9 @@ example, .CS set s [\fBencoding convertfrom\fR euc-jp "\\xA4\\xCF"] .CE -would return the Unicode string "\\u306F", which is the Hiragana -letter HA. +would return the Unicode string +.QW "\\u306F" , +which is the Hiragana letter HA. .SH "SEE ALSO" fconfigure(n), Tcl_GetEncoding(3) .SH KEYWORDS @@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: exec.n,v 1.17 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: exec.n,v 1.18 2007/10/25 14:07:32 dkf Exp $ '\" .so man.macros .TH exec n 8.5 Tcl "Tcl Built-In Commands" @@ -428,9 +428,10 @@ differences in behaviour between \fBexec\fR and DOS batch files. .PP When in doubt, use the command \fBauto_execok\fR: it will return the complete path to the program as seen by the \fBexec\fR command. This -applies especially when you want to run "internal" commands like -\fIdir\fR from a Tcl script (if you just want to list filenames, use -the \fBglob\fR command.) To do that, use this: +applies especially when you want to run +.QW "internal" +commands like \fIdir\fR from a Tcl script (if you just want to list +filenames, use the \fBglob\fR command.) To do that, use this: .CS \fBexec\fR {*}[auto_execok dir] *.tcl .CE diff --git a/doc/fcopy.n b/doc/fcopy.n index 69e6016..d59ddf8 100644 --- a/doc/fcopy.n +++ b/doc/fcopy.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: fcopy.n,v 1.12 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: fcopy.n,v 1.13 2007/10/25 14:07:32 dkf Exp $ '\" .so man.macros .TH fcopy n 8.0 Tcl "Tcl Built-In Commands" @@ -59,7 +59,9 @@ then all data already queued for \fIoutchan\fR is written out. Note that \fIinchan\fR can become readable during a background copy. You should turn off any \fBfileevent\fR handlers during a background copy so those handlers do not interfere with the copy. -Any I/O attempted by a \fBfileevent\fR handler will get a "channel busy" error. +Any I/O attempted by a \fBfileevent\fR handler will get a +.QW "channel busy" +error. .PP \fBFcopy\fR translates end-of-line sequences in \fIinchan\fR and \fIoutchan\fR according to the \fB\-translation\fR option @@ -78,15 +80,16 @@ means that the incoming characters are converted internally first UTF-8 and then into the encoding of the channel \fBfcopy\fR writes to. See the manual entry for \fBfconfigure\fR for details on the \fB\-encoding\fR and \fB\-translation\fR options. No conversion is -done if both channels are -set to encoding "binary" and have matching translations. If only the -output channel is set to -encoding "binary" the system will write the internal UTF-8 -representation of the incoming characters. If only the input channel -is set to encoding "binary" the system will assume that the incoming -bytes are valid UTF-8 characters and convert them according to the -output encoding. The behaviour of the system for bytes which are not -valid UTF-8 characters is undefined in this case. +done if both channels are set to encoding +.QW "binary" +and have matching translations. If only the output channel is set to encoding +.QW "binary" +the system will write the internal UTF-8 representation of the incoming +characters. If only the input channel is set to encoding +.QW "binary" +the system will assume that the incoming bytes are valid UTF-8 characters and +convert them according to the output encoding. The behaviour of the system for +bytes which are not valid UTF-8 characters is undefined in this case. .SH EXAMPLES .PP The first example transfers the contents of one channel exactly to @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: file.n,v 1.45 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: file.n,v 1.46 2007/10/25 14:07:32 dkf Exp $ '\" .so man.macros .TH file n 8.3 Tcl "Tcl Built-In Commands" @@ -47,11 +47,11 @@ flags and their values. The second form returns the value for the specific option. The third form sets one or more of the values. The values are as follows: .PP -On Unix, \fB-group\fR gets or sets the group name for the file. A group id -can be given to the command, but it returns a group name. \fB-owner\fR gets +On Unix, \fB\-group\fR gets or sets the group name for the file. A group id +can be given to the command, but it returns a group name. \fB\-owner\fR gets or sets the user name of the owner of the file. The command returns the owner name, but the numerical id can be passed when setting the -owner. \fB-permissions\fR sets or retrieves the octal code that chmod(1) +owner. \fB\-permissions\fR sets or retrieves the octal code that chmod(1) uses. This command does also has limited support for setting using the symbolic attributes for chmod(1), of the form [ugo]?[[+\-=][rwxst],[...]], where multiple symbolic attributes can be separated by commas (example: @@ -59,24 +59,24 @@ where multiple symbolic attributes can be separated by commas (example: permissions for group and other). A simplified \fBls\fR style string, of the form rwxrwxrwx (must be 9 characters), is also supported (example: \fBrwxr\-xr\-t\fR is equivalent to 01755). -On versions of Unix supporting file flags, \fB-readonly\fR gives the +On versions of Unix supporting file flags, \fB\-readonly\fR gives the value or sets or clears the readonly attribute of the file, i.e. the user immutable flag \fBuchg\fR to chflags(1). .PP -On Windows, \fB-archive\fR gives the value or sets or clears the -archive attribute of the file. \fB-hidden\fR gives the value or sets -or clears the hidden attribute of the file. \fB-longname\fR will +On Windows, \fB\-archive\fR gives the value or sets or clears the +archive attribute of the file. \fB\-hidden\fR gives the value or sets +or clears the hidden attribute of the file. \fB\-longname\fR will expand each path element to its long version. This attribute cannot be -set. \fB-readonly\fR gives the value or sets or clears the readonly -attribute of the file. \fB-shortname\fR gives a string where every +set. \fB\-readonly\fR gives the value or sets or clears the readonly +attribute of the file. \fB\-shortname\fR gives a string where every path element is replaced with its short (8.3) version of the -name. This attribute cannot be set. \fB-system\fR gives or sets or +name. This attribute cannot be set. \fB\-system\fR gives or sets or clears the value of the system attribute of the file. .PP -On Mac OS X and Darwin, \fB-creator\fR gives or sets the -Finder creator type of the file. \fB-hidden\fR gives or sets or clears -the hidden attribute of the file. \fB-readonly\fR gives or sets or -clears the readonly attribute of the file. \fB-rsrclength\fR gives +On Mac OS X and Darwin, \fB\-creator\fR gives or sets the +Finder creator type of the file. \fB\-hidden\fR gives or sets or clears +the hidden attribute of the file. \fB\-readonly\fR gives or sets or +clears the readonly attribute of the file. \fB\-rsrclength\fR gives the length of the resource fork of the file, this attribute can only be set to the value 0, which results in the resource fork being stripped off the file. @@ -198,7 +198,7 @@ is always canonical for the current platform: \fB/\fR for Unix and Windows. .RE .TP -\fBfile link ?\fI-linktype\fR? \fIlinkName\fR ?\fItarget\fR? +\fBfile link ?\fI\-linktype\fR? \fIlinkName\fR ?\fItarget\fR? . If only one argument is given, that argument is assumed to be \fIlinkName\fR, and this command returns the value of the link given by @@ -219,15 +219,20 @@ link is created. . If the user wishes to make a link of a specific type only, (and signal an error if for some reason that is not possible), then the optional -\fI-linktype\fR argument should be given. Accepted values for -\fI-linktype\fR are "-symbolic" and "-hard". +\fI\-linktype\fR argument should be given. Accepted values for +\fI\-linktype\fR are +.QW "\-symbolic" +and +.QW "\-hard" . . On Unix, symbolic links can be made to relative paths, and those paths must be relative to the actual \fIlinkName\fR's location (not to the cwd), but on all other platforms where relative links are not supported, target paths will always be converted to absolute, normalized form before the link is created (and therefore relative paths are interpreted -as relative to the cwd). Furthermore, "~user" paths are always expanded +as relative to the cwd). Furthermore, +.QW "~user" +paths are always expanded to absolute form. When creating links on filesystems that either do not support any links, or do not support the specific type requested, an error message will be returned. In particular Windows 95, 98 and ME do @@ -427,13 +432,15 @@ Returns a string giving the type of file \fIname\fR, which will be one of .TP \fBfile volumes\fR . -Returns the absolute paths to the volumes mounted on the system, as a -proper Tcl list. Without any virtual filesystems mounted as root -volumes, on UNIX, the command will always return "/", since all -filesystems are locally mounted. -On Windows, it will return a list of the available local drives -(e.g. {a:/ c:/}). If any virtual filesystem has mounted additional -volumes, they will be in the returned list. +Returns the absolute paths to the volumes mounted on the system, as a proper +Tcl list. Without any virtual filesystems mounted as root volumes, on UNIX, +the command will always return +.QW "/" , +since all filesystems are locally mounted. On Windows, it will return a list +of the available local drives (e.g. +.QW "a:/ c:/" ). +If any virtual filesystem has mounted additional volumes, they will be in the +returned list. .TP \fBfile writable \fIname\fR . diff --git a/doc/filename.n b/doc/filename.n index c0bad63..65403bd 100644 --- a/doc/filename.n +++ b/doc/filename.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: filename.n,v 1.15 2007/07/04 13:25:54 dkf Exp $ +'\" RCS: @(#) $Id: filename.n,v 1.16 2007/10/25 14:07:32 dkf Exp $ '\" .so man.macros .TH filename n 7.5 Tcl "Tcl Built-In Commands" @@ -142,29 +142,36 @@ will be correctly substituted using the \fB$HOME\fR environment variable, just like for Unix. .SH "PORTABILITY ISSUES" .PP -Not all file systems are case sensitive, so scripts should avoid code -that depends on the case of characters in a file name. In addition, -the character sets allowed on different devices may differ, so scripts -should choose file names that do not contain special characters like: -\fB<>:?"/\e|\fR. The safest approach is to use names consisting of -alphanumeric characters only. Care should be taken with filenames -which contain spaces (common on Windows systems) and -filenames where the backslash is the directory separator (Windows -native path names). Also Windows 3.1 only supports file -names with a root of no more than 8 characters and an extension of no -more than 3 characters. +Not all file systems are case sensitive, so scripts should avoid code that +depends on the case of characters in a file name. In addition, the character +sets allowed on different devices may differ, so scripts should choose file +names that do not contain special characters like: \fB<>:?"/\e|\fR. +.\"" Reset emacs highlighting +The safest approach is to use names consisting of alphanumeric characters +only. Care should be taken with filenames which contain spaces (common on +Windows systems) and filenames where the backslash is the directory separator +(Windows native path names). Also Windows 3.1 only supports file names with a +root of no more than 8 characters and an extension of no more than 3 +characters. .PP -On Windows platforms there are file and path length restrictions. -Complete paths or filenames longer than about 260 characters will lead -to errors in most file operations. +On Windows platforms there are file and path length restrictions. Complete +paths or filenames longer than about 260 characters will lead to errors in +most file operations. .PP -Another Windows peculiarity is that any number of trailing dots '.' in -filenames are totally ignored, so, for example, attempts to create a -file or directory with a name "foo." will result in the creation of a -file/directory with name "foo". This fact is reflected in the -results of 'file normalize'. Furthermore, a file name consisting only -of dots '.........' or dots with trailing characters '.....abc' is -illegal. +Another Windows peculiarity is that any number of trailing dots +.QW "." +in filenames are totally ignored, so, for example, attempts to create a file +or directory with a name +.QW "foo." +will result in the creation of a file or directory with name +.QW "foo" . +This fact is reflected in the results of +.QW \fBfile normalize\fR . +Furthermore, a file name consisting only of dots +.QW "........." +or dots with trailing characters +.QW ".....abc" +is illegal. .SH KEYWORDS current directory, absolute file name, relative file name, volume-relative file name, portability diff --git a/doc/format.n b/doc/format.n index 3c6178d..e2386f6 100644 --- a/doc/format.n +++ b/doc/format.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: format.n,v 1.15 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: format.n,v 1.16 2007/10/25 14:07:32 dkf Exp $ '\" .so man.macros .TH format n 8.1 Tcl "Tcl Built-In Commands" @@ -175,8 +175,9 @@ If the precision is 0 then no decimal point is output. .TP 10 \fBe\fR or \fBE\fR Convert number to scientific notation in the -form \fIx.yyy\fBe\(+-\fIzz\fR, where the number of \fIy\fR's is determined -by the precision (default: 6). +form +.QW "\fIx.yyy\fBe\(+-\fIzz\fR" , +where the number of \fIy\fR's is determined by the precision (default: 6). If the precision is 0 then no decimal point is output. If the \fBE\fR form is used then \fBE\fR is printed instead of \fBe\fR. @@ -7,7 +7,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: info.n,v 1.19 2007/07/04 13:51:29 dkf Exp $ +'\" RCS: @(#) $Id: info.n,v 1.20 2007/10/25 14:07:32 dkf Exp $ '\" .so man.macros .TH info n 8.4 Tcl "Tcl Built-In Commands" @@ -23,7 +23,7 @@ info \- Return information about the state of the Tcl interpreter .PP This command provides information about various internals of the Tcl interpreter. -The legal \fIoption\fR's (which may be abbreviated) are: +The legal \fIoption\fRs (which may be abbreviated) are: .TP \fBinfo args \fIprocname\fR Returns a list containing the names of the arguments to procedure @@ -98,12 +98,16 @@ gives a level relative to the current command (0 refers to the current command, i.e., \fBinfo frame\fR itself, -1 to its caller, and so on). .sp This is similar to how \fBinfo level\fR works, except that this -subcommand reports all frames, like \fBsource\fR'd scripts, -\fBeval\fR's, \fBuplevel\fR's, etc. +subcommand reports all frames, like \fBsource\fRd scripts, +\fBeval\fRs, \fBuplevel\fRs, etc. .sp -Note that for nested commands, like "foo [[bar [[x]]]]" only "x" will -be seen by an \fBinfo frame\fR invoked within "x". This is the same as -for \fBinfo level\fR and error stack traces. +Note that for nested commands, like +.QW "foo [[bar [[x]]]]" +only +.QW "x" +will be seen by an \fBinfo frame\fR invoked within +.QW "x" . +This is the same as for \fBinfo level\fR and error stack traces. .sp The result dictionary may contain the keys listed below, with the specified meanings for their values: @@ -313,7 +317,9 @@ If \fIpattern\fR is a qualified name, the resulting list of variable names has each matching namespace variable qualified with the name of its namespace. -Note that a currently-visible variable may not yet "exist" if it has not +Note that a currently-visible variable may not yet +.QW "exist" +if it has not been set (e.g. a variable declared but not set by \fBvariable\fR). .SH EXAMPLE This command prints out a procedure suitable for saving in a Tcl diff --git a/doc/mathfunc.n b/doc/mathfunc.n index 1b2cf83..054e47d 100644 --- a/doc/mathfunc.n +++ b/doc/mathfunc.n @@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: mathfunc.n,v 1.13 2006/12/06 01:42:00 das Exp $ +'\" RCS: @(#) $Id: mathfunc.n,v 1.14 2007/10/25 14:07:32 dkf Exp $ '\" .so man.macros .TH mathfunc n 8.5 Tcl "Tcl Mathematical Functions" @@ -85,9 +85,13 @@ package require \fBTcl 8.5\fR .SH "DESCRIPTION" .PP The \fBexpr\fR command handles mathematical functions of the form -\fBsin($x)\fR or \fBatan2($y,$x)\fR by converting them to calls of the -form \fB[tcl::mathfunc::sin [expr {$x}]]\fR or -\fB[tcl::mathfunc::atan2 [expr {$y}] [expr {$x}]]\fR. +.QW \fBsin($x)\fR +or +.QW \fBatan2($y,$x)\fR +by converting them to calls of the form +.QW "\fB[tcl::mathfunc::sin [expr {$x}]]\fR" +or +.QW "\fB[tcl::mathfunc::atan2 [expr {$y}] [expr {$x}]]\fR" . A number of math functions are available by default within the namespace \fB::tcl::mathfunc\fR; these functions are also available for code apart from \fBexpr\fR, by invoking the given commands @@ -109,46 +113,59 @@ of which work solely with floating-point numbers unless otherwise noted: .PP .TP \fBabs(\fIarg\fB)\fR +. Returns the absolute value of \fIarg\fR. \fIArg\fR may be either integer or floating-point, and the result is returned in the same form. .TP \fBacos(\fIarg\fB)\fR +. Returns the arc cosine of \fIarg\fR, in the range [\fI0\fR,\fIpi\fR] radians. \fIArg\fR should be in the range [\fI-1\fR,\fI1\fR]. .TP \fBasin(\fIarg\fB)\fR +. Returns the arc sine of \fIarg\fR, in the range [\fI-pi/2\fR,\fIpi/2\fR] radians. \fIArg\fR should be in the range [\fI-1\fR,\fI1\fR]. .TP \fBatan(\fIarg\fB)\fR +. Returns the arc tangent of \fIarg\fR, in the range [\fI-pi/2\fR,\fIpi/2\fR] radians. .TP \fBatan2(\fIy, x\fB)\fR +. Returns the arc tangent of \fIy\fR/\fIx\fR, in the range [\fI-pi\fR,\fIpi\fR] radians. \fIx\fR and \fIy\fR cannot both be 0. If \fIx\fR is greater than \fI0\fR, this is equivalent to \fBatan(\fIy/x\fB)\fR. .TP \fBbool(\fIarg\fB)\fR +. Accepts any numeric value, or any string acceptable to \fBstring is boolean\fR, and returns the corresponding boolean value \fB0\fR or \fB1\fR. Non-zero numbers are true. Other numbers are false. Non-numeric strings produce boolean value in -agreement with \fBstring is true\fR and \fBstring is false\fR. +agreement with +.QW "\fBstring is true\fR" +and +.QW "\fBstring is false\fR" . .TP \fBceil(\fIarg\fB)\fR +. Returns the smallest integral floating-point value (i.e. with a zero fractional part) not less than \fIarg\fR. The argument may be any numeric value. .TP \fBcos(\fIarg\fB)\fR +. Returns the cosine of \fIarg\fR, measured in radians. .TP \fBcosh(\fIarg\fB)\fR +. Returns the hyperbolic cosine of \fIarg\fR. If the result would cause an overflow, an error is returned. .TP \fBdouble(\fIarg\fB)\fR +. The argument may be any numeric value, If \fIarg\fR is a floating-point value, returns \fIarg\fR, otherwise converts \fIarg\fR to floating-point and returns the converted value. May return @@ -164,23 +181,28 @@ truncate their range to fit in particular storage widths. .VE 8.5 .TP \fBexp(\fIarg\fB)\fR +. Returns the exponential of \fIarg\fR, defined as \fIe\fR**\fIarg\fR. If the result would cause an overflow, an error is returned. .TP \fBfloor(\fIarg\fB)\fR +. Returns the largest integral floating-point value (i.e. with a zero fractional part) not greater than \fIarg\fR. The argument may be any numeric value. .TP \fBfmod(\fIx, y\fB)\fR +. Returns the floating-point remainder of the division of \fIx\fR by \fIy\fR. If \fIy\fR is 0, an error is returned. .TP \fBhypot(\fIx, y\fB)\fR +. Computes the length of the hypotenuse of a right-angled triangle -\fBsqrt(\fIx\fR*\fIx\fR+\fIy\fR*\fIy\fB)\fR. +.QW "\fBsqrt(\fIx\fR*\fIx\fR+\fIy\fR*\fIy\fB)\fR" . .TP \fBint(\fIarg\fB)\fR +. The argument may be any numeric value. The integer part of \fIarg\fR is determined, and then the low order bits of that integer value up to the machine word size are returned as an integer value. For reference, @@ -188,32 +210,39 @@ the number of bytes in the machine word are stored in \fBtcl_platform(wordSize)\fR. .TP \fBisqrt(\fIarg\fB)\fR +. Computes the integer part of the square root of \fIarg\fR. \fIArg\fR must be a positive value, either an integer or a floating point number. Unlike \fBsqrt\fR, which is limited to the precision of a floating point number, \fIisqrt\fR will return a result of arbitrary precision. .TP \fBlog(\fIarg\fB)\fR +. Returns the natural logarithm of \fIarg\fR. \fIArg\fR must be a positive value. .TP \fBlog10(\fIarg\fB)\fR +. Returns the base 10 logarithm of \fIarg\fR. \fIArg\fR must be a positive value. .TP \fBmax(\fIarg\fB, \fI...\fB)\fR +. Accepts one or more numeric arguments. Returns the one argument with the greatest value. .TP \fBmin(\fIarg\fB, \fI...\fB)\fR +. Accepts one or more numeric arguments. Returns the one argument with the least value. .TP \fBpow(\fIx, y\fB)\fR +. Computes the value of \fIx\fR raised to the power \fIy\fR. If \fIx\fR is negative, \fIy\fR must be an integer value. .TP \fBrand()\fR +. Returns a pseudo-random floating-point value in the range (\fI0\fR,\fI1\fR). The generator algorithm is a simple linear congruential generator that is not cryptographically secure. Each result from \fBrand\fR completely @@ -223,34 +252,42 @@ one-time passwords. The seed of the generator is initialized from the internal clock of the machine or may be set with the \fBsrand\fR function. .TP \fBround(\fIarg\fB)\fR +. If \fIarg\fR is an integer value, returns \fIarg\fR, otherwise converts \fIarg\fR to integer by rounding and returns the converted value. .TP \fBsin(\fIarg\fB)\fR +. Returns the sine of \fIarg\fR, measured in radians. .TP \fBsinh(\fIarg\fB)\fR +. Returns the hyperbolic sine of \fIarg\fR. If the result would cause an overflow, an error is returned. .TP \fBsqrt(\fIarg\fB)\fR +. The argument may be any non-negative numeric value. Returns a floating-point value that is the square root of \fIarg\fR. May return \fBInf\fR when the argument is a numeric value that exceeds the square of the maximum value of the floating-point range. .TP \fBsrand(\fIarg\fB)\fR +. The \fIarg\fR, which must be an integer, is used to reset the seed for the random number generator of \fBrand\fR. Returns the first random number (see \fBrand()\fR) from that seed. Each interpreter has its own seed. .TP \fBtan(\fIarg\fB)\fR +. Returns the tangent of \fIarg\fR, measured in radians. .TP \fBtanh(\fIarg\fB)\fR +. Returns the hyperbolic tangent of \fIarg\fR. .TP \fBwide(\fIarg\fB)\fR +. The argument may be any numeric value. The integer part of \fIarg\fR is determined, and then the low order 64 bits of that integer value are returned as an integer value. @@ -265,8 +302,8 @@ for new implementations. .SH "SEE ALSO" expr(n), namespace(n) .SH "COPYRIGHT" -Copyright (c) 1993 The Regents of the University of California. -.br -Copyright (c) 1994-2000 Sun Microsystems Incorporated. -.br -Copyright (c) 2005, 2006 by Kevin B. Kenny <kennykb@acm.org>. +.nf +Copyright \(co 1993 The Regents of the University of California. +Copyright \(co 1994-2000 Sun Microsystems Incorporated. +Copyright \(co 2005, 2006 by Kevin B. Kenny <kennykb@acm.org>. +.fi diff --git a/doc/mathop.n b/doc/mathop.n index 108cbd5..fd7c673 100644 --- a/doc/mathop.n +++ b/doc/mathop.n @@ -4,7 +4,7 @@ .\" See the file "license.terms" for information on usage and redistribution .\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. .\" -.\" RCS: @(#) $Id: mathop.n,v 1.4 2006/12/19 14:22:06 dkf Exp $ +.\" RCS: @(#) $Id: mathop.n,v 1.5 2007/10/25 14:07:32 dkf Exp $ .\" .so man.macros .TH mathop n 8.5 Tcl "Tcl Mathematical Operator Commands" @@ -125,7 +125,10 @@ Each \fInumber\fR must have an integral value. . Returns the result of raising each value to the power of the result of recursively operating on the result of processing the following arguments, so -\fB** 2 3 4\fR is the same as \fB** 2 [** 3 4]\fR. Each \fInumber\fR may be +.QW "\fB** 2 3 4\fR" +is the same as +.QW "\fB** 2 [** 3 4]\fR" . +Each \fInumber\fR may be any numeric value, though the second number must not be fractional if the first is negative. If no arguments are given, the result will be one, and if only one argument is given, the result will be that argument. diff --git a/doc/memory.n b/doc/memory.n index 034c41e..0c2cd7b 100644 --- a/doc/memory.n +++ b/doc/memory.n @@ -3,7 +3,7 @@ '\" Copyright (c) 2000 by Scriptics Corporation. '\" All rights reserved. '\" -'\" RCS: @(#) $Id: memory.n,v 1.6 2004/09/06 09:44:57 dkf Exp $ +'\" RCS: @(#) $Id: memory.n,v 1.7 2007/10/25 14:07:32 dkf Exp $ '\" .so man.macros .TH memory n 8.1 Tcl "Tcl Built-In Commands" @@ -13,7 +13,6 @@ memory \- Control Tcl memory debugging capabilities .SH SYNOPSIS \fBmemory \fIoption \fR?\fIarg arg ...\fR? .BE - .SH DESCRIPTION .PP The \fBmemory\fR command gives the Tcl developer control of Tcl's memory @@ -23,9 +22,11 @@ memory debugging enabled (when \fBTCL_MEM_DEBUG\fR is defined at compile time), and after \fBTcl_InitMemory\fR has been called. .TP \fBmemory active\fR \fIfile\fR +. Write a list of all currently allocated memory to the specified \fIfile\fR. .TP \fBmemory break_on_malloc\fR \fIcount\fR +. After the \fIcount\fR allocations have been performed, \fBckalloc\fR outputs a message to this effect and that it is now attempting to enter the C debugger. Tcl will then issue a \fISIGINT\fR signal against itself. @@ -33,22 +34,26 @@ If you are running Tcl under a C debugger, it should then enter the debugger command mode. .TP \fBmemory info\fR +. Returns a report containing the total allocations and frees since Tcl began, the current packets allocated (the current number of calls to \fBckalloc\fR not met by a corresponding call to \fBckfree\fR), the current bytes allocated, and the maximum number of packets and bytes allocated. .TP -\fB memory init [on|off]\fR +\fBmemory init \fR[\fBon\fR|\fBoff\fR] +. Turn on or off the pre-initialization of all allocated memory with bogus bytes. Useful for detecting the use of uninitialized values. .TP \fBmemory onexit\fR \fIfile\fR +. Causes a list of all allocated memory to be written to the specified \fIfile\fR during the finalization of Tcl's memory subsystem. Useful for checking that memory is properly cleaned up during process exit. .TP \fBmemory tag\fR \fIstring\fR +. Each packet of memory allocated by \fBckalloc\fR can have associated with it a string-valued tag. In the lists of allocated memory generated by \fBmemory active\fR and \fBmemory onexit\fR, the tag for each packet @@ -56,8 +61,8 @@ is printed along with other information about the packet. The \fBmemory tag\fR command sets the tag value for subsequent calls to \fBckalloc\fR to be \fIstring\fR. .TP -\fBmemory trace [on|off]\fR -.br +\fBmemory trace \fR[\fBon\fR|\fBoff\fR] +. Turns memory tracing on or off. When memory tracing is on, every call to \fBckalloc\fR causes a line of trace information to be written to \fIstderr\fR, consisting of the word \fIckalloc\fR, followed by the @@ -71,8 +76,11 @@ Calls to \fBckfree\fR are traced in the same manner. .RE .TP \fBmemory trace_on_at_malloc\fR \fIcount\fR -Enable memory tracing after \fIcount\fR \fBckalloc\fR's have been performed. -For example, if you enter \fBmemory trace_on_at_malloc 100\fR, +. +Enable memory tracing after \fIcount\fR \fBckalloc\fRs have been performed. +For example, if you enter +.QW "\fBmemory trace_on_at_malloc 100\fR" , +. after the 100th call to \fBckalloc\fR, memory trace information will begin being displayed for all allocations and frees. Since there can be a lot of memory activity before a problem occurs, judicious use of this option @@ -81,7 +89,8 @@ produced), if you can identify a number of allocations that occur before the problem sets in. The current number of memory allocations that have occurred since Tcl started is printed on a guard zone failure. .TP -\fBmemory validate [on|off]\fR +\fBmemory validate \fR[\fBon\fR|\fBoff\fR] +. Turns memory validation on or off. When memory validation is enabled, on every call to \fBckalloc\fR or \fBckfree\fR, the guard zones are checked for every piece of memory currently in existence that was @@ -92,9 +101,8 @@ overwrite can be detected on the first call to \fBckalloc\fR or \fBckfree\fR after the overwrite occurred, rather than when the specific memory with the overwritten guard zone(s) is freed, which may occur long after the overwrite occurred. - .SH "SEE ALSO" -ckalloc, ckfree, Tcl_ValidateAllMemory, Tcl_DumpActiveMemory, TCL_MEM_DEBUG - +ckalloc(3), ckfree(3), Tcl_ValidateAllMemory(3), Tcl_DumpActiveMemory(3), +TCL_MEM_DEBUG .SH KEYWORDS memory, debug diff --git a/doc/regexp.n b/doc/regexp.n index 4aa88e2..a7243f4 100644 --- a/doc/regexp.n +++ b/doc/regexp.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: regexp.n,v 1.21 2007/10/25 09:25:27 dkf Exp $ +'\" RCS: @(#) $Id: regexp.n,v 1.22 2007/10/25 14:07:32 dkf Exp $ '\" .so man.macros .TH regexp n 8.3 Tcl "Tcl Built-In Commands" @@ -143,7 +143,7 @@ absolute beginning of the input string. Marks the end of switches. The argument following this one will be treated as \fIexp\fR even if it starts with a \fB\-\fR. .PP -If there are more \fIsubMatchVar\fR's than parenthesized +If there are more \fIsubMatchVar\fRs than parenthesized subexpressions within \fIexp\fR, or if a particular subexpression in \fIexp\fR doesn't match the string (e.g. because it was in a portion of the expression that wasn't matched), then the corresponding diff --git a/doc/registry.n b/doc/registry.n index a3e3489..1ea38f1 100644 --- a/doc/registry.n +++ b/doc/registry.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: registry.n,v 1.15 2007/07/04 14:45:19 dkf Exp $ +'\" RCS: @(#) $Id: registry.n,v 1.16 2007/10/25 14:07:32 dkf Exp $ '\" .so man.macros .TH registry n 1.1 registry "Tcl Bundled Packages" @@ -152,8 +152,9 @@ represented in Tcl as a string. . The registry value contains a null-terminated string that contains unexpanded references to environment variables in the normal Windows -style (for example, "%PATH%"). The data is represented in Tcl as a -string. +style (for example, +.QW "%PATH%" ). +The data is represented in Tcl as a string. .TP \fBdword\fR . diff --git a/doc/source.n b/doc/source.n index 283e5e4..a5b6ebe 100644 --- a/doc/source.n +++ b/doc/source.n @@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: source.n,v 1.12 2007/10/25 09:38:45 dkf Exp $ +'\" RCS: @(#) $Id: source.n,v 1.13 2007/10/25 14:07:32 dkf Exp $ '\" .so man.macros .TH source n "" Tcl "Tcl Built-In Commands" @@ -32,8 +32,10 @@ If a \fBreturn\fR command is invoked from within the script then the remainder of the file will be skipped and the \fBsource\fR command will return normally with the result from the \fBreturn\fR command. .PP -The end-of-file character for files is '\\32' (^Z) for all platforms. -The source command will read files up to this character. This +The end-of-file character for files is +.QW \e032 +(^Z) for all platforms. The source command will read files up to this +character. This restriction does not exist for the \fBread\fR or \fBgets\fR commands, allowing for files containing code and data segments (scripted documents). If you require a diff --git a/doc/string.n b/doc/string.n index aefec02..3860c96 100644 --- a/doc/string.n +++ b/doc/string.n @@ -5,7 +5,7 @@ .\" See the file "license.terms" for information on usage and redistribution .\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. .\" -.\" RCS: @(#) $Id: string.n,v 1.36 2007/10/25 10:09:00 dkf Exp $ +.\" RCS: @(#) $Id: string.n,v 1.37 2007/10/25 14:07:32 dkf Exp $ .\" .so man.macros .TH string n 8.1 Tcl "Tcl Built-In Commands" @@ -274,12 +274,21 @@ Matches any character in the set given by \fIchars\fR. If a sequence of the form \fIx\fB\-\fIy\fR appears in \fIchars\fR, then any character between \fIx\fR and \fIy\fR, inclusive, will match. When used with \fB\-nocase\fR, the end points of the range are converted to -lower case first. Whereas {[A\-z]} matches '_' when matching -case-sensitively ('_' falls between the 'Z' and 'a'), with -\fB\-nocase\fR this is considered like {[A\-Za\-z]} (and probably what -was meant in the first place). +lower case first. Whereas +.QW [A\-z] +matches +.QW _ +when matching case-sensitively (since +.QW _ +falls between the +.QW Z +and +.QW a ), +with \fB\-nocase\fR this is considered like +.QW [A\-Za\-z] +(and probably what was meant in the first place). .IP \fB\e\fIx\fR 10 -Matches the single character \fIx\fR. This provides a way of avoiding +Matches the single character \fIx\fR. This provides a way of avoiding the special interpretation of the characters \fB*?[]\e\fR in \fIpattern\fR. .RE diff --git a/doc/tcltest.n b/doc/tcltest.n index 72e16ab..4691229 100644 --- a/doc/tcltest.n +++ b/doc/tcltest.n @@ -8,7 +8,7 @@ '\" 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.49 2007/10/24 14:29:39 dkf Exp $ +'\" RCS: @(#) $Id: tcltest.n,v 1.50 2007/10/25 14:07:32 dkf Exp $ '\" .so man.macros .TH "tcltest" n 2.3 tcltest "Tcl Bundled Packages" @@ -79,12 +79,12 @@ in and exported from the \fB::tcltest\fR namespace, as indicated in the \fBSYNOPSIS\fR above. In the following sections, all commands will be described by their simple names, in the interest of brevity. .PP -The central command of \fBtcltest\fR is [\fBtest\fR] that defines -and runs a test. Testing with [\fBtest\fR] involves evaluation +The central command of \fBtcltest\fR is \fBtest\fR that defines +and runs a test. Testing with \fBtest\fR involves evaluation of a Tcl script and comparing the result to an expected result, as configured and controlled by a number of options. Several other commands provided by \fBtcltest\fR govern the configuration of -[\fBtest\fR] and the collection of many [\fBtest\fR] commands into +\fBtest\fR and the collection of many \fBtest\fR commands into test suites. .PP See \fBCREATING TEST SUITES WITH TCLTEST\fR below for an extended example @@ -95,30 +95,31 @@ for your Tcl-enabled code. \fBtest\fR \fIname description ?option value ...?\fR Defines and possibly runs a test with the name \fIname\fR and description \fIdescription\fR. The name and description of a test -are used in messages reported by [\fBtest\fR] during the +are used in messages reported by \fBtest\fR during the test, as configured by the options of \fBtcltest\fR. The -remaining \fIoption value\fR arguments to [\fBtest\fR] +remaining \fIoption value\fR arguments to \fBtest\fR define the test, including the scripts to run, the conditions under which to run them, the expected result, and the means by which the expected and actual results should be compared. See \fBTESTS\fR below for a complete description of the valid -options and how they define a test. The [\fBtest\fR] command +options and how they define a test. The \fBtest\fR command returns an empty string. .TP \fBtest\fR \fIname description ?constraints? body result\fR -This form of [\fBtest\fR] is provided to support test suites written +. +This form of \fBtest\fR is provided to support test suites written for version 1 of the \fBtcltest\fR package, and also a simpler interface for a common usage. It is the same as -[\fBtest\fR \fIname description\fB -constraints \fIconstraints\fB -body -\fIbody\fB -result \fIresult\fR]. All other options to [\fBtest\fR] +.QW "\fBtest\fR \fIname description\fB \-constraints \fIconstraints\fB \-body \fIbody\fB \-result \fIresult\fR" . +All other options to \fBtest\fR take their default values. When \fIconstraints\fR is omitted, this -form of [\fBtest\fR] can be distinguished from the first because +form of \fBtest\fR can be distinguished from the first because all \fIoption\fRs begin with .QW \- . .TP \fBloadTestedCommands\fR Evaluates in the caller's context the script specified by -[\fBconfigure -load\fR] or [\fBconfigure -loadfile\fR]. +\fBconfigure \-load\fR or \fBconfigure \-loadfile\fR. Returns the result of that script evaluation, including any error raised by the script. Use this command and the related configuration options to provide the commands to be tested to @@ -127,31 +128,31 @@ the interpreter running the test suite. \fBmakeFile\fR \fIcontents name ?directory?\fR Creates a file named \fIname\fR relative to directory \fIdirectory\fR and write \fIcontents\fR -to that file using the encoding [\fBencoding system\fR]. +to that file using the encoding \fBencoding system\fR. If \fIcontents\fR does not end with a newline, a newline will be appended so that the file named \fIname\fR does end with a newline. Because the system encoding is used, this command is only suitable for making text files. The file will be removed by the next evaluation -of [\fBcleanupTests\fR], unless it is removed by -[\fBremoveFile\fR] first. The default value of -\fIdirectory\fR is the directory [\fBconfigure -tmpdir\fR]. +of \fBcleanupTests\fR, unless it is removed by +\fBremoveFile\fR first. The default value of +\fIdirectory\fR is the directory \fBconfigure -tmpdir\fR. Returns the full path of the file created. Use this command to create any text file required by a test with contents as needed. .TP \fBremoveFile\fR \fIname ?directory?\fR Forces the file referenced by \fIname\fR to be removed. This file name should be relative to \fIdirectory\fR. The default value of -\fIdirectory\fR is the directory [\fBconfigure -tmpdir\fR]. +\fIdirectory\fR is the directory \fBconfigure -tmpdir\fR. Returns an empty string. Use this command to delete files -created by [\fBmakeFile\fR]. +created by \fBmakeFile\fR. .TP \fBmakeDirectory\fR \fIname ?directory?\fR Creates a directory named \fIname\fR relative to directory \fIdirectory\fR. -The directory will be removed by the next evaluation of [\fBcleanupTests\fR], -unless it is removed by [\fBremoveDirectory\fR] first. +The directory will be removed by the next evaluation of \fBcleanupTests\fR, +unless it is removed by \fBremoveDirectory\fR first. The default value of \fIdirectory\fR is the directory -[\fBconfigure -tmpdir\fR]. +\fBconfigure -tmpdir\fR. Returns the full path of the directory created. Use this command to create any directories that are required to exist by a test. .TP @@ -159,16 +160,16 @@ to create any directories that are required to exist by a test. Forces the directory referenced by \fIname\fR to be removed. This directory should be relative to \fIdirectory\fR. The default value of \fIdirectory\fR is the directory -[\fBconfigure -tmpdir\fR]. +\fBconfigure -tmpdir\fR. Returns an empty string. Use this command to delete any directories -created by [\fBmakeDirectory\fR]. +created by \fBmakeDirectory\fR. .TP \fBviewFile\fR \fIfile ?directory?\fR Returns the contents of \fIfile\fR, except for any -final newline, just as [\fBread -nonewline\fR] would return. +final newline, just as \fBread -nonewline\fR would return. This file name should be relative to \fIdirectory\fR. The default value of \fIdirectory\fR is the directory -[\fBconfigure -tmpdir\fR]. Use this command +\fBconfigure -tmpdir\fR. Use this command as a convenient way to turn the contents of a file generated by a test into the result of that test for matching against an expected result. The contents of the file are read using @@ -179,16 +180,16 @@ files. Intended to clean up and summarize after several tests have been run. Typically called once per test file, at the end of the file after all tests have been completed. For best effectiveness, be -sure that the [\fBcleanupTests\fR] is evaluated even if an error +sure that the \fBcleanupTests\fR is evaluated even if an error occurs earlier in the test file evaluation. .sp Prints statistics about the tests run and removes files that were -created by [\fBmakeDirectory\fR] and [\fBmakeFile\fR] since the -last [\fBcleanupTests\fR]. Names of files and directories -in the directory [\fBconfigure -tmpdir\fR] created since -the last [\fBcleanupTests\fR], but not created by -[\fBmakeFile\fR] or [\fBmakeDirectory\fR] are printed -to [\fBoutputChannel\fR]. This command also restores the original +created by \fBmakeDirectory\fR and \fBmakeFile\fR since the +last \fBcleanupTests\fR. Names of files and directories +in the directory \fBconfigure -tmpdir\fR created since +the last \fBcleanupTests\fR, but not created by +\fBmakeFile\fR or \fBmakeDirectory\fR are printed +to \fBoutputChannel\fR. This command also restores the original shell environment, as described by the ::env array. Returns an empty string. .TP @@ -197,7 +198,7 @@ This is a master command meant to run an entire suite of tests, spanning multiple files and/or directories, as governed by the configurable options of \fBtcltest\fR. See \fBRUNNING ALL TESTS\fR below for a complete description of the many variations possible -with [\fBrunAllTests\fR]. +with \fBrunAllTests\fR. .SH "CONFIGURATION COMMANDS" .TP \fBconfigure\fR @@ -215,19 +216,20 @@ corresponding value \fIvalue\fR, in order. Raises an error if an \fIoption\fR is not a supported configurable option, or if \fIvalue\fR is not a valid value for the corresponding \fIoption\fR, or if a \fIvalue\fR is not provided. When an error is raised, the -operation of [\fBconfigure\fR] is halted, and subsequent \fIoption value\fR +operation of \fBconfigure\fR is halted, and subsequent \fIoption value\fR arguments are not processed. .sp If the environment variable \fB::env(TCLTEST_OPTIONS)\fR exists when -the \fBtcltest\fR package is loaded (by [\fBpackage require tcltest\fR]) -then its value is taken as a list of arguments to pass to [\fBconfigure\fR]. +the \fBtcltest\fR package is loaded (by +.QW "\fBpackage require tcltest\fR" ) +then its value is taken as a list of arguments to pass to \fBconfigure\fR. This allows the default values of the configuration options to be set by the environment. .TP \fBcustomMatch \fImode script\fR Registers \fImode\fR as a new legal value of the \fB\-match\fR option -to [\fBtest\fR]. When the \fB\-match \fImode\fR option is -passed to [\fBtest\fR], the script \fIscript\fR will be evaluated +to \fBtest\fR. When the \fB\-match \fImode\fR option is +passed to \fBtest\fR, the script \fIscript\fR will be evaluated to compare the actual result of evaluating the body of the test to the expected result. To perform the match, the \fIscript\fR is completed with two additional @@ -235,82 +237,82 @@ words, the expected result, and the actual result, and the completed script is evaluated in the global namespace. The completed script is expected to return a boolean value indicating whether or not the results match. The built-in matching modes of -[\fBtest\fR] are \fBexact\fR, \fBglob\fR, and \fBregexp\fR. +\fBtest\fR are \fBexact\fR, \fBglob\fR, and \fBregexp\fR. .TP \fBtestConstraint \fIconstraint ?boolean?\fR Sets or returns the boolean value associated with the named \fIconstraint\fR. See \fBTEST CONSTRAINTS\fR below for more information. .TP \fBinterpreter\fR \fI?executableName?\fR -Sets or returns the name of the executable to be [\fBexec\fR]ed by -[\fBrunAllTests\fR] to run each test file when -[\fBconfigure -singleproc\fR] is false. -The default value for [\fBinterpreter\fR] is the name of the -currently running program as returned by [\fBinfo nameofexecutable\fR]. +Sets or returns the name of the executable to be \fBexec\fRed by +\fBrunAllTests\fR to run each test file when +\fBconfigure -singleproc\fR is false. +The default value for \fBinterpreter\fR is the name of the +currently running program as returned by \fBinfo nameofexecutable\fR. .TP \fBoutputChannel\fR \fI?channelID?\fR Sets or returns the output channel ID. This defaults to stdout. Any test that prints test related output should send -that output to [\fBoutputChannel\fR] rather than letting +that output to \fBoutputChannel\fR rather than letting that output default to stdout. .TP \fBerrorChannel\fR \fI?channelID?\fR Sets or returns the error channel ID. This defaults to stderr. Any test that prints error messages should send -that output to [\fBerrorChannel\fR] rather than printing +that output to \fBerrorChannel\fR rather than printing directly to stderr. .SH "SHORTCUT COMMANDS" .TP \fBdebug \fI?level?\fR -Same as [\fBconfigure -debug \fI?level?\fR]. +Same as \fBconfigure -debug \fI?level?\fR. .TP \fBerrorFile \fI?filename?\fR -Same as [\fBconfigure -errfile \fI?filename?\fR]. +Same as \fBconfigure -errfile \fI?filename?\fR. .TP \fBlimitConstraints \fI?boolean?\fR -Same as [\fBconfigure -limitconstraints \fI?boolean?\fR]. +Same as \fBconfigure -limitconstraints \fI?boolean?\fR. .TP \fBloadFile \fI?filename?\fR -Same as [\fBconfigure -loadfile \fI?filename?\fR]. +Same as \fBconfigure -loadfile \fI?filename?\fR. .TP \fBloadScript \fI?script?\fR -Same as [\fBconfigure -load \fI?script?\fR]. +Same as \fBconfigure -load \fI?script?\fR. .TP \fBmatch \fI?patternList?\fR -Same as [\fBconfigure -match \fI?patternList?\fR]. +Same as \fBconfigure -match \fI?patternList?\fR. .TP \fBmatchDirectories \fI?patternList?\fR -Same as [\fBconfigure -relateddir \fI?patternList?\fR]. +Same as \fBconfigure -relateddir \fI?patternList?\fR. .TP \fBmatchFiles \fI?patternList?\fR -Same as [\fBconfigure -file \fI?patternList?\fR]. +Same as \fBconfigure -file \fI?patternList?\fR. .TP \fBoutputFile \fI?filename?\fR -Same as [\fBconfigure -outfile \fI?filename?\fR]. +Same as \fBconfigure -outfile \fI?filename?\fR. .TP \fBpreserveCore \fI?level?\fR -Same as [\fBconfigure -preservecore \fI?level?\fR]. +Same as \fBconfigure -preservecore \fI?level?\fR. .TP \fBsingleProcess \fI?boolean?\fR -Same as [\fBconfigure -singleproc \fI?boolean?\fR]. +Same as \fBconfigure -singleproc \fI?boolean?\fR. .TP \fBskip \fI?patternList?\fR -Same as [\fBconfigure -skip \fI?patternList?\fR]. +Same as \fBconfigure -skip \fI?patternList?\fR. .TP \fBskipDirectories \fI?patternList?\fR -Same as [\fBconfigure -asidefromdir \fI?patternList?\fR]. +Same as \fBconfigure -asidefromdir \fI?patternList?\fR. .TP \fBskipFiles \fI?patternList?\fR -Same as [\fBconfigure -notfile \fI?patternList?\fR]. +Same as \fBconfigure -notfile \fI?patternList?\fR. .TP \fBtemporaryDirectory \fI?directory?\fR -Same as [\fBconfigure -tmpdir \fI?directory?\fR]. +Same as \fBconfigure -tmpdir \fI?directory?\fR. .TP \fBtestsDirectory \fI?directory?\fR -Same as [\fBconfigure -testdir \fI?directory?\fR]. +Same as \fBconfigure -testdir \fI?directory?\fR. .TP \fBverbose \fI?level?\fR -Same as [\fBconfigure -verbose \fI?level?\fR]. +Same as \fBconfigure -verbose \fI?level?\fR. .SH "OTHER COMMANDS" .PP The remaining commands provided by \fBtcltest\fR have better @@ -319,14 +321,14 @@ are retained to support existing test suites, but should be avoided in new code. .TP \fBtest\fR \fIname description optionList\fR -This form of [\fBtest\fR] was provided to enable passing many -options spanning several lines to [\fBtest\fR] as a single +This form of \fBtest\fR was provided to enable passing many +options spanning several lines to \fBtest\fR as a single argument quoted by braces, rather than needing to backslash quote -the newlines between arguments to [\fBtest\fR]. The \fIoptionList\fR +the newlines between arguments to \fBtest\fR. The \fIoptionList\fR argument is expected to be a list with an even number of elements representing \fIoption\fR and \fIvalue\fR arguments to pass -to [\fBtest\fR]. However, these values are not passed directly, as -in the alternate forms of [\fBswitch\fR]. Instead, this form makes +to \fBtest\fR. However, these values are not passed directly, as +in the alternate forms of \fBswitch\fR. Instead, this form makes an unfortunate attempt to overthrow Tcl's substitution rules by performing substitutions on some of the list elements as an attempt to implement a @@ -340,13 +342,13 @@ form is really not necessary to avoid backslash-quoted newlines. If you insist on using this form, examine the source code of \fBtcltest\fR if you want to know the substitution details, or just enclose the third through last argument -to [\fBtest\fR] in braces and hope for the best. +to \fBtest\fR in braces and hope for the best. .TP \fBworkingDirectory\fR \fI?directoryName?\fR Sets or returns the current working directory when the test suite is running. The default value for workingDirectory is the directory in -which the test suite was launched. The Tcl commands [\fBcd\fR] and -[\fBpwd\fR] are sufficient replacements. +which the test suite was launched. The Tcl commands \fBcd\fR and +\fBpwd\fR are sufficient replacements. .TP \fBnormalizeMsg\fR \fImsg\fR Returns the result of removing the @@ -355,13 +357,13 @@ newlines from \fImsg\fR, where .QW extra is rather imprecise. Tcl offers plenty of string processing commands to modify strings as you wish, and -[\fBcustomMatch\fR] allows flexible matching of actual and expected +\fBcustomMatch\fR allows flexible matching of actual and expected results. .TP \fBnormalizePath\fR \fIpathVar\fR Resolves symlinks in a path, thus creating a path without internal redirection. It is assumed that \fIpathVar\fR is absolute. -\fIpathVar\fR is modified in place. The Tcl command [\fBfile normalize\fR] +\fIpathVar\fR is modified in place. The Tcl command \fBfile normalize\fR is a sufficient replacement. .TP \fBbytestring\fR \fIstring\fR @@ -371,18 +373,18 @@ value supplied in \fIstring\fR. This allows the tester to create denormalized or improperly formed strings to pass to C procedures that are supposed to accept strings with embedded NULL types and confirm that a string result has a certain pattern of bytes. This is -exactly equivalent to the Tcl command [\fBencoding convertfrom identity\fR]. +exactly equivalent to the Tcl command \fBencoding convertfrom identity\fR. .SH TESTS .PP -The [\fBtest\fR] command is the heart of the \fBtcltest\fR package. +The \fBtest\fR command is the heart of the \fBtcltest\fR package. Its essential function is to evaluate a Tcl script and compare -the result with an expected result. The options of [\fBtest\fR] +the result with an expected result. The options of \fBtest\fR define the test script, the environment in which to evaluate it, the expected result, and how the compare the actual result to the expected result. Some configuration options of \fBtcltest\fR -also influence how [\fBtest\fR] operates. +also influence how \fBtest\fR operates. .PP -The valid options for [\fBtest\fR] are summarized: +The valid options for \fBtest\fR are summarized: .PP .CS \fBtest\fR \fIname\fR \fIdescription\fR @@ -413,12 +415,12 @@ it is best to have the same test name continue to correspond to the same test, so that it remains meaningful to say things like .QW "Test foo-1.3 passed in all releases up to 3.4, but began failing in release 3.5." .PP -During evaluation of [\fBtest\fR], the \fIname\fR will be compared +During evaluation of \fBtest\fR, the \fIname\fR will be compared to the lists of string matching patterns returned by -[\fBconfigure -match\fR], and [\fBconfigure -skip\fR]. The test +\fBconfigure -match\fR, and \fBconfigure -skip\fR. The test will be run only if \fIname\fR matches any of the patterns from -[\fBconfigure -match\fR] and matches none of the patterns -from [\fBconfigure -skip\fR]. +\fBconfigure -match\fR and matches none of the patterns +from \fBconfigure -skip\fR. .PP The \fIdescription\fR should be a short textual description of the test. The \fIdescription\fR is included in output produced by the @@ -434,17 +436,17 @@ Valid attributes and associated values are: The optional \fB\-constraints\fR attribute can be list of one or more keywords or an expression. If the \fB\-constraints\fR value is a list of keywords, each of these keywords should be the name of a constraint -defined by a call to [\fBtestConstraint\fR]. If any of the listed +defined by a call to \fBtestConstraint\fR. If any of the listed constraints is false or does not exist, the test is skipped. If the \fB\-constraints\fR value is an expression, that expression is evaluated. If the expression evaluates to true, then the test is run. Note that the expression form of \fB\-constraints\fR may interfere with the -operation of [\fBconfigure -constraints\fR] and -[\fBconfigure -limitconstraints\fR], and is not recommended. +operation of \fBconfigure -constraints\fR and +\fBconfigure -limitconstraints\fR, and is not recommended. Appropriate constraints should be added to any tests that should not always be run. That is, conditional evaluation of a test should be accomplished by the \fB\-constraints\fR option, not by -conditional evaluation of [\fBtest\fR]. In that way, the same +conditional evaluation of \fBtest\fR. In that way, the same number of tests are always reported by the test suite, though the number skipped may change based on the testing environment. The default value is an empty list. @@ -473,7 +475,7 @@ The default value is an empty script. The \fB\-match\fR attribute determines how expected answers supplied by \fB\-result\fR, \fB\-output\fR, and \fB\-errorOutput\fR are compared. Valid values for \fImode\fR are \fBregexp\fR, \fBglob\fR, \fBexact\fR, and -any value registered by a prior call to [\fBcustomMatch\fR]. The default +any value registered by a prior call to \fBcustomMatch\fR. The default value is \fBexact\fR. .TP \fB\-result \fIexpectedValue\fR @@ -483,18 +485,18 @@ an empty string. .TP \fB\-output \fIexpectedValue\fR The \fB\-output\fR attribute supplies the \fIexpectedValue\fR against which -any output sent to \fBstdout\fR or [\fBoutputChannel\fR] during evaluation +any output sent to \fBstdout\fR or \fBoutputChannel\fR during evaluation of the script(s) will be compared. Note that only output printed using -[\fB::puts\fR] is used for comparison. If \fB\-output\fR is not specified, -output sent to \fBstdout\fR and [\fBoutputChannel\fR] is not processed for +\fB::puts\fR is used for comparison. If \fB\-output\fR is not specified, +output sent to \fBstdout\fR and \fBoutputChannel\fR is not processed for comparison. .TP \fB\-errorOutput \fIexpectedValue\fR The \fB\-errorOutput\fR attribute supplies the \fIexpectedValue\fR against -which any output sent to \fBstderr\fR or [\fBerrorChannel\fR] during +which any output sent to \fBstderr\fR or \fBerrorChannel\fR during evaluation of the script(s) will be compared. Note that only output -printed using [\fB::puts\fR] is used for comparison. If \fB\-errorOutput\fR -is not specified, output sent to \fBstderr\fR and [\fBerrorChannel\fR] is +printed using \fB::puts\fR is used for comparison. If \fB\-errorOutput\fR +is not specified, output sent to \fBstderr\fR and \fBerrorChannel\fR is not processed for comparison. .TP \fB\-returnCodes \fIexpectedCodeList\fR @@ -502,7 +504,7 @@ The optional \fB\-returnCodes\fR attribute supplies \fIexpectedCodeList\fR, a list of return codes that may be accepted from evaluation of the \fB\-body\fR script. If evaluation of the \fB\-body\fR script returns a code not in the \fIexpectedCodeList\fR, the test fails. All -return codes known to [\fBreturn\fR], in both numeric and symbolic +return codes known to \fBreturn\fR, in both numeric and symbolic form, including extended return codes, are acceptable elements in the \fIexpectedCodeList\fR. Default value is \fB{ok return}\fR. .PP @@ -512,42 +514,42 @@ its result must match expected values, and if specified, output and error data from the test must match expected \fB\-output\fR and \fB\-errorOutput\fR values. If any of these conditions are not met, then the test fails. Note that all scripts are evaluated in the context of the caller -of [\fBtest\fR]. +of \fBtest\fR. .PP -As long as [\fBtest\fR] is called with valid syntax and legal +As long as \fBtest\fR is called with valid syntax and legal values for all attributes, it will not raise an error. Test -failures are instead reported as output written to [\fBoutputChannel\fR]. +failures are instead reported as output written to \fBoutputChannel\fR. In default operation, a successful test produces no output. The output -messages produced by [\fBtest\fR] are controlled by the -[\fBconfigure -verbose\fR] option as described in \fBCONFIGURABLE OPTIONS\fR +messages produced by \fBtest\fR are controlled by the +\fBconfigure \-verbose\fR option as described in \fBCONFIGURABLE OPTIONS\fR below. Any output produced by the test scripts themselves should be -produced using [\fB::puts\fR] to [\fBoutputChannel\fR] or -[\fBerrorChannel\fR], so that users of the test suite may -easily capture output with the [\fBconfigure -outfile\fR] and -[\fBconfigure -errfile\fR] options, and so that the \fB\-output\fR +produced using \fB::puts\fR to \fBoutputChannel\fR or +\fBerrorChannel\fR, so that users of the test suite may +easily capture output with the \fBconfigure \-outfile\fR and +\fBconfigure \-errfile\fR options, and so that the \fB\-output\fR and \fB\-errorOutput\fR attributes work properly. .SH "TEST CONSTRAINTS" .PP Constraints are used to determine whether or not a test should be skipped. Each constraint has a name, which may be any string, and a boolean -value. Each [\fBtest\fR] has a \fB\-constraints\fR value which is a +value. Each \fBtest\fR has a \fB\-constraints\fR value which is a list of constraint names. There are two modes of constraint control. Most frequently, the default mode is used, indicated by a setting -of [\fBconfigure -limitconstraints\fR] to false. The test will run +of \fBconfigure \-limitconstraints\fR to false. The test will run only if all constraints in the list are true-valued. Thus, -the \fB\-constraints\fR option of [\fBtest\fR] is a convenient, symbolic +the \fB\-constraints\fR option of \fBtest\fR is a convenient, symbolic way to define any conditions required for the test to be possible or -meaningful. For example, a [\fBtest\fR] with \fB\-constraints unix\fR +meaningful. For example, a \fBtest\fR with \fB\-constraints unix\fR will only be run if the constraint \fBunix\fR is true, which indicates the test suite is being run on a Unix platform. .PP -Each [\fBtest\fR] should include whatever \fB\-constraints\fR are +Each \fBtest\fR should include whatever \fB\-constraints\fR are required to constrain it to run only where appropriate. Several constraints are pre-defined in the \fBtcltest\fR package, listed below. The registration of user-defined constraints is performed -by the [\fBtestConstraint\fR] command. User-defined constraints +by the \fBtestConstraint\fR command. User-defined constraints may appear within a test file, or within the script specified -by the [\fBconfigure -load\fR] or [\fBconfigure -loadfile\fR] +by the \fBconfigure \-load\fR or \fBconfigure \-loadfile\fR options. .PP The following is a list of constraints pre-defined by the @@ -653,22 +655,23 @@ test can only run if Unix user is root test can only run if Unix user is not root .TP \fIeformat\fR -test can only run if app has a working version of sprintf with respect -to the "e" format of floating-point numbers. +test can only run if app has a working version of sprintf with respect to the +.QW "e" +format of floating-point numbers. .TP \fIstdio\fR -test can only be run if [\fBinterpreter\fR] can be [\fBopen\fR]ed +test can only be run if \fBinterpreter\fR can be \fBopen\fRed as a pipe. .PP The alternative mode of constraint control is enabled by setting -[\fBconfigure -limitconstraints\fR] to true. With that configuration +\fBconfigure \-limitconstraints\fR to true. With that configuration setting, all existing constraints other than those in the constraint -list returned by [\fBconfigure -constraints\fR] are set to false. -When the value of [\fBconfigure -constraints\fR] +list returned by \fBconfigure \-constraints\fR are set to false. +When the value of \fBconfigure \-constraints\fR is set, all those constraints are set to true. The effect is that -when both options [\fBconfigure -constraints\fR] and -[\fBconfigure -limitconstraints\fR] are in use, only those tests including -only constraints from the [\fBconfigure -constraints\fR] list +when both options \fBconfigure \-constraints\fR and +\fBconfigure \-limitconstraints\fR are in use, only those tests including +only constraints from the \fBconfigure \-constraints\fR list are run; all others are skipped. For example, one might set up a configuration with .PP @@ -682,20 +685,20 @@ to run exactly those tests that exercise known bugs, and discover whether any of them pass, indicating the bug had been fixed. .SH "RUNNING ALL TESTS" .PP -The single command [\fBrunAllTests\fR] is evaluated to run an entire +The single command \fBrunAllTests\fR is evaluated to run an entire test suite, spanning many files and directories. The configuration options of \fBtcltest\fR control the precise operations. The -[\fBrunAllTests\fR] command begins by printing a summary of its -configuration to [\fBoutputChannel\fR]. +\fBrunAllTests\fR command begins by printing a summary of its +configuration to \fBoutputChannel\fR. .PP Test files to be evaluated are sought in the directory -[\fBconfigure -testdir\fR]. The list of files in that directory -that match any of the patterns in [\fBconfigure -file\fR] and -match none of the patterns in [\fBconfigure -notfile\fR] is generated +\fBconfigure \-testdir\fR. The list of files in that directory +that match any of the patterns in \fBconfigure \-file\fR and +match none of the patterns in \fBconfigure \-notfile\fR is generated and sorted. Then each file will be evaluated in turn. If -[\fBconfigure -singleproc\fR] is true, then each file will -be [\fBsource\fR]d in the caller's context. If it is false, -then a copy of [\fBinterpreter\fR] will be [\fBexec\fR]d to +\fBconfigure \-singleproc\fR is true, then each file will +be \fBsource\fRd in the caller's context. If it is false, +then a copy of \fBinterpreter\fR will be \fBexec\fRd to evaluate each file. The multi-process operation is useful when testing can cause errors so severe that a process terminates. Although such an error may terminate a child @@ -703,17 +706,17 @@ process evaluating one file, the master process can continue with the rest of the test suite. In multi-process operation, the configuration of \fBtcltest\fR in the master process is passed to the child processes as command line arguments, -with the exception of [\fBconfigure -outfile\fR]. The -[\fBrunAllTests\fR] command in the +with the exception of \fBconfigure \-outfile\fR. The +\fBrunAllTests\fR command in the master process collects all output from the child processes and collates their results into one master report. Any reports of individual test failures, or messages requested -by a [\fBconfigure -verbose\fR] setting are passed directly -on to [\fBoutputChannel\fR] by the master process. +by a \fBconfigure \-verbose\fR setting are passed directly +on to \fBoutputChannel\fR by the master process. .PP After evaluating all selected test files, a summary of the -results is printed to [\fBoutputChannel\fR]. The summary -includes the total number of [\fBtest\fR]s evaluated, broken +results is printed to \fBoutputChannel\fR. The summary +includes the total number of \fBtest\fRs evaluated, broken down into those skipped, those passed, and those failed. The summary also notes the number of files evaluated, and the names of any files with failing tests or errors. A list of @@ -721,29 +724,29 @@ the constraints that caused tests to be skipped, and the number of tests skipped for each is also printed. Also, messages are printed if it appears that evaluation of a test file has caused any temporary files to be left -behind in [\fBconfigure -tmpdir\fR]. +behind in \fBconfigure \-tmpdir\fR. .PP Having completed and summarized all selected test files, -[\fBrunAllTests\fR] then recursively acts on subdirectories -of [\fBconfigure -testdir\fR]. All subdirectories that -match any of the patterns in [\fBconfigure -relateddir\fR] +\fBrunAllTests\fR then recursively acts on subdirectories +of \fBconfigure \-testdir\fR. All subdirectories that +match any of the patterns in \fBconfigure \-relateddir\fR and do not match any of the patterns in -[\fBconfigure -asidefromdir\fR] are examined. If +\fBconfigure \-asidefromdir\fR are examined. If a file named \fBall.tcl\fR is found in such a directory, -it will be [\fBsource\fR]d in the caller's context. +it will be \fBsource\fRd in the caller's context. Whether or not an examined directory contains an \fBall.tcl\fR file, its subdirectories are also scanned -against the [\fBconfigure -relateddir\fR] and -[\fBconfigure -asidefromdir\fR] patterns. In this way, +against the \fBconfigure \-relateddir\fR and +\fBconfigure \-asidefromdir\fR patterns. In this way, many directories in a directory tree can have all their -test files evaluated by a single [\fBrunAllTests\fR] +test files evaluated by a single \fBrunAllTests\fR command. .SH "CONFIGURABLE OPTIONS" -The [\fBconfigure\fR] command is used to set and query the configurable +The \fBconfigure\fR command is used to set and query the configurable options of \fBtcltest\fR. The valid options are: .TP \fB\-singleproc \fIboolean\fR -Controls whether or not [\fBrunAllTests\fR] spawns a child process for +Controls whether or not \fBrunAllTests\fR spawns a child process for each test file. No spawning when \fIboolean\fR is true. Default value is false. .TP @@ -751,15 +754,15 @@ value is false. Sets the debug level to \fIlevel\fR, an integer value indicating how much debugging information should be printed to stdout. Note that debug messages always go to stdout, independent of the value of -[\fBconfigure -outfile\fR]. Default value is 0. Levels are defined as: +\fBconfigure \-outfile\fR. Default value is 0. Levels are defined as: .RS .IP 0 Do not display any debug information. .IP 1 Display information regarding whether a test is skipped because it doesn't match any of the tests that were specified using by -[\fBconfigure -match\fR] (userSpecifiedNonMatch) or matches any of -the tests specified by [\fBconfigure -skip\fR] (userSpecifiedSkip). Also +\fBconfigure \-match\fR (userSpecifiedNonMatch) or matches any of +the tests specified by \fBconfigure \-skip\fR (userSpecifiedSkip). Also print warnings about possible lack of cleanup or balance in test files. Also print warnings about any re-use of test names. .IP 2 @@ -793,8 +796,10 @@ does not match its expected return code Print source file line information of failed tests .RE The single letter abbreviations noted above are also recognized -so that [\fBconfigure -verbose pt\fR] is the same as -[\fBconfigure -verbose {pass start}\fR]. +so that +.QW "\fBconfigure \-verbose pt\fR" +is the same as +.QW "\fBconfigure \-verbose {pass start}\fR" . .TP \fB\-preservecore \fIlevel\fR Sets the core preservation level to \fIlevel\fR. This level @@ -802,86 +807,91 @@ determines how stringent checks for core files are. Default value is 0. Levels are defined as: .RS .IP 0 -No checking - do not check for core files at the end of each test -command, but do check for them in [\fBrunAllTests\fR] after all +No checking \(em do not check for core files at the end of each test +command, but do check for them in \fBrunAllTests\fR after all test files have been evaluated. .IP 1 -Also check for core files at the end of each [\fBtest\fR] command. +Also check for core files at the end of each \fBtest\fR command. .IP 2 Check for core files at all times described above, and save a -copy of each core file produced in [\fBconfigure -tmpdir\fR]. +copy of each core file produced in \fBconfigure \-tmpdir\fR. .RE .TP \fB\-limitconstraints \fIboolean\fR -Sets the mode by which [\fBtest\fR] honors constraints as described +Sets the mode by which \fBtest\fR honors constraints as described in \fBTESTS\fR above. Default value is false. .TP \fB\-constraints \fIlist\fR Sets all the constraints in \fIlist\fR to true. Also used in -combination with [\fBconfigure -limitconstraints true\fR] to control an +combination with +.QW "\fBconfigure \-limitconstraints true\fR" +to control an alternative constraint mode as described in \fBTESTS\fR above. Default value is an empty list. .TP \fB\-tmpdir \fIdirectory\fR -Sets the temporary directory to be used by [\fBmakeFile\fR], -[\fBmakeDirectory\fR], [\fBviewFile\fR], [\fBremoveFile\fR], -and [\fBremoveDirectory\fR] as the default directory where +Sets the temporary directory to be used by \fBmakeFile\fR, +\fBmakeDirectory\fR, \fBviewFile\fR, \fBremoveFile\fR, +and \fBremoveDirectory\fR as the default directory where temporary files and directories created by test files should -be created. Default value is [\fBworkingDirectory\fR]. +be created. Default value is \fBworkingDirectory\fR. .TP \fB\-testdir \fIdirectory\fR -Sets the directory searched by [\fBrunAllTests\fR] for test files -and subdirectories. Default value is [\fBworkingDirectory\fR]. +Sets the directory searched by \fBrunAllTests\fR for test files +and subdirectories. Default value is \fBworkingDirectory\fR. .TP \fB\-file \fIpatternList\fR -Sets the list of patterns used by [\fBrunAllTests\fR] to determine +Sets the list of patterns used by \fBrunAllTests\fR to determine what test files to evaluate. Default value is \fB*.test\fR. .TP \fB\-notfile \fIpatternList\fR -Sets the list of patterns used by [\fBrunAllTests\fR] to determine -what test files to skip. Default value is \fBl.*.test\fR, so -that any SCCS lock files are skipped. +Sets the list of patterns used by \fBrunAllTests\fR to determine +what test files to skip. Default value is +.QW \fBl.*.test\fR , +so that any SCCS lock files are skipped. .TP \fB\-relateddir \fIpatternList\fR -Sets the list of patterns used by [\fBrunAllTests\fR] to determine +Sets the list of patterns used by \fBrunAllTests\fR to determine what subdirectories to search for an \fBall.tcl\fR file. Default -value is \fB*\fR. +value is +.QW \fB*\fR . .TP \fB\-asidefromdir \fIpatternList\fR -Sets the list of patterns used by [\fBrunAllTests\fR] to determine +Sets the list of patterns used by \fBrunAllTests\fR to determine what subdirectories to skip when searching for an \fBall.tcl\fR file. Default value is an empty list. .TP \fB\-match \fIpatternList\fR -Set the list of patterns used by [\fBtest\fR] to determine whether -a test should be run. Default value is \fB*\fR. +Set the list of patterns used by \fBtest\fR to determine whether +a test should be run. Default value is +.QW \fB*\fR . .TP \fB\-skip \fIpatternList\fR -Set the list of patterns used by [\fBtest\fR] to determine whether +Set the list of patterns used by \fBtest\fR to determine whether a test should be skipped. Default value is an empty list. .TP \fB\-load \fIscript\fR -Sets a script to be evaluated by [\fBloadTestedCommands\fR]. +Sets a script to be evaluated by \fBloadTestedCommands\fR. Default value is an empty script. .TP \fB\-loadfile \fIfilename\fR Sets the filename from which to read a script to be evaluated -by [\fBloadTestedCommands\fR]. This is an alternative to +by \fBloadTestedCommands\fR. This is an alternative to \fB\-load\fR. They cannot be used together. .TP \fB\-outfile \fIfilename\fR Sets the file to which all output produced by tcltest should be -written. A file named \fIfilename\fR will be [\fBopen\fR]ed for writing, -and the resulting channel will be set as the value of [\fBoutputChannel\fR]. +written. A file named \fIfilename\fR will be \fBopen\fRed for writing, +and the resulting channel will be set as the value of \fBoutputChannel\fR. .TP \fB\-errfile \fIfilename\fR Sets the file to which all error output produced by tcltest -should be written. A file named \fIfilename\fR will be [\fBopen\fR]ed +should be written. A file named \fIfilename\fR will be \fBopen\fRed for writing, and the resulting channel will be set as the value -of [\fBerrorChannel\fR]. +of \fBerrorChannel\fR. .SH "CREATING TEST SUITES WITH TCLTEST" .PP -The fundamental element of a test suite is the individual [\fBtest\fR] +The fundamental element of a test suite is the individual \fBtest\fR command. We begin with several examples. .IP [1] Test of a script that returns normally. @@ -935,17 +945,17 @@ Test with a constraint. .CE .RE .PP -At the next higher layer of organization, several [\fBtest\fR] commands +At the next higher layer of organization, several \fBtest\fR commands are gathered together into a single test file. Test files should have names with the \fB.test\fR extension, because that is the default pattern -used by [\fBrunAllTests\fR] to find test files. It is a good rule of +used by \fBrunAllTests\fR to find test files. It is a good rule of thumb to have one test file for each source code file of your project. It is good practice to edit the test file and the source code file together, keeping tests synchronized with code changes. .PP -Most of the code in the test file should be the [\fBtest\fR] commands. +Most of the code in the test file should be the \fBtest\fR commands. Use constraints to skip tests, rather than conditional evaluation -of [\fBtest\fR]. +of \fBtest\fR. .IP [5] Recommended system for writing conditional tests, using constraints to guard: @@ -978,24 +988,25 @@ prior tests in the file. Those prior tests might be skipped. If several consecutive tests require the same context, the appropriate setup and cleanup scripts may be stored in variable for passing to each tests \fB\-setup\fR and \fB\-cleanup\fR options. This is a better solution than -performing setup outside of [\fBtest\fR] commands, because the setup will +performing setup outside of \fBtest\fR commands, because the setup will only be done if necessary, and any errors during setup will be reported, and not cause the test file to abort. .PP A test file should be able to be combined with other test files and not -interfere with them, even when [\fBconfigure -singleproc 1\fR] causes -all files to be evaluated in a common interpreter. A simple way to +interfere with them, even when +.QW "\fBconfigure -singleproc 1\fR" +causes all files to be evaluated in a common interpreter. A simple way to achieve this is to have your tests define all their commands and variables in a namespace that is deleted when the test file evaluation is complete. A good namespace to use is a child namespace \fBtest\fR of the namespace of the module you are testing. .PP A test file should also be able to be evaluated directly as a script, -not depending on being called by a master [\fBrunAllTests\fR]. This +not depending on being called by a master \fBrunAllTests\fR. This means that each test file should process command line arguments to give the tester all the configuration control that \fBtcltest\fR provides. .PP -After all [\fBtest\fR]s in a test file, the command [\fBcleanupTests\fR] +After all \fBtest\fRs in a test file, the command \fBcleanupTests\fR should be called. .IP [7] Here is a sketch of a sample test file illustrating those points: @@ -1027,9 +1038,9 @@ namespace delete ::example::test .PP The next level of organization is a full test suite, made up of several test files. One script is used to control the entire suite. The -basic function of this script is to call [\fBrunAllTests\fR] after +basic function of this script is to call \fBrunAllTests\fR after doing any necessary setup. This script is usually named \fBall.tcl\fR -because that's the default name used by [\fBrunAllTests\fR] when combining +because that's the default name used by \fBrunAllTests\fR when combining multiple test suites into one testing run. .IP [8] Here is a sketch of a sample test suite master script: @@ -1039,7 +1050,7 @@ Here is a sketch of a sample test suite master script: package require Tcl 8.4 package require tcltest 2.2 package require example -\fB::tcltest::configure\fR -testdir \\ +\fB::tcltest::configure\fR -testdir \e [file dirname [file normalize [info script]]] eval \fB::tcltest::configure\fR $argv \fB::tcltest::runAllTests\fR @@ -1054,8 +1065,9 @@ here. They are no longer part of the supported public interface of to continue to support existing test suites written to the older interface specifications, many of those deprecated commands and variables still work as before. For example, in many circumstances, -[\fBconfigure\fR] will be automatically called shortly after -[\fBpackage require tcltest 2.1\fR] succeeds with arguments +\fBconfigure\fR will be automatically called shortly after +.QW "\fBpackage require tcltest 2.1\fR" +succeeds with arguments from the variable \fB::argv\fR. This is to support test suites that depend on the old behavior that \fBtcltest\fR was automatically configured from command line arguments. New test files should not @@ -1067,7 +1079,7 @@ eval \fB::tcltest::configure\fR $::argv .PP to establish a configuration from command line arguments. .SH "KNOWN ISSUES" -There are two known issues related to nested evaluations of [\fBtest\fR]. +There are two known issues related to nested evaluations of \fBtest\fR. The first issue relates to the stack level in which test scripts are executed. Tests nested within other tests may be executed at the same stack level as the outermost test. For example, in the following code: @@ -1084,15 +1096,26 @@ stack level as the outermost test. For example, in the following code: any script executed in level-2.1 may be executed at the same stack level as the script defined for level-1.1. .PP -In addition, while two [\fBtest\fR]s have been run, results will only -be reported by [\fBcleanupTests\fR] for tests at the same level as +In addition, while two \fBtest\fRs have been run, results will only +be reported by \fBcleanupTests\fR for tests at the same level as test level-1.1. However, test results for all tests run prior to level-1.1 will be available when test level-2.1 runs. What this means is that if you try to access the test results for test level-2.1, -it will may say that 'm' tests have run, 'n' tests have -been skipped, 'o' tests have passed and 'p' tests have failed, -where 'm', 'n', 'o', and 'p' refer to tests that were run at the -same test level as test level-1.1. +it will may say that +.QW m +tests have run, +.QW n +tests have been skipped, +.QW o +tests have passed and +.QW p +tests have failed, where +.QW m , +.QW n , +.QW o , +and +.QW p +refer to tests that were run at the same test level as test level-1.1. .PP Implementation of output and error comparison in the test command depends on usage of ::puts in your application code. Output is @@ -1100,7 +1123,7 @@ intercepted by redefining the ::puts command while the defined test script is being run. Errors thrown by C procedures or printed directly from C applications will not be caught by the test command. Therefore, usage of the \fB\-output\fR and \fB\-errorOutput\fR -options to [\fBtest\fR] is useful only for pure Tcl applications -that use [\fB::puts\fR] to produce output. +options to \fBtest\fR is useful only for pure Tcl applications +that use \fB::puts\fR to produce output. .SH KEYWORDS test, test harness, test suite @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: tm.n,v 1.7 2007/10/24 14:29:39 dkf Exp $ +'\" RCS: @(#) $Id: tm.n,v 1.8 2007/10/25 14:07:32 dkf Exp $ '\" .so man.macros .TH tm n 8.5 Tcl "Tcl Built-In Commands" @@ -175,11 +175,11 @@ Both package name \fBPNAME\fR and package version \fBPVERSION\fR are extracted from the filename \fBMF\fR according to the definition below: .CS -\fBMF\fR = /module_path/\fBPNAME'\fR-\fBPVERSION\fR.tm +\fBMF\fR = /module_path/\fBPNAME\(fm\fR-\fBPVERSION\fR.tm .CE .PP -Where \fBPNAME'\fR is the partial path of the module as defined in -section \fBFINDING MODULES\fR, and translated into \fB\fRPNAME by +Where \fBPNAME\(fm\fR is the partial path of the module as defined in +section \fBFINDING MODULES\fR, and translated into \fBPNAME\fR by changing all directory separators to .QW \fB::\fR , and \fBmodule_path\fR is the path (from the list of paths to search) diff --git a/doc/trace.n b/doc/trace.n index 9fb53c9..7ab4f07 100644 --- a/doc/trace.n +++ b/doc/trace.n @@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: trace.n,v 1.19 2007/10/25 10:02:17 dkf Exp $ +'\" RCS: @(#) $Id: trace.n,v 1.20 2007/10/25 14:07:32 dkf Exp $ '\" .so man.macros .TH trace n "8.4" Tcl "Tcl Built-In Commands" @@ -21,7 +21,7 @@ trace \- Monitor variable accesses, command usages and command executions .SH DESCRIPTION .PP This command causes Tcl commands to be executed whenever certain operations are -invoked. The legal \fIoption\fR's (which may be abbreviated) are: +invoked. The legal \fIoption\fRs (which may be abbreviated) are: .TP \fBtrace add \fItype name ops ?args?\fR Where \fItype\fR is \fBcommand\fR, \fBexecution\fR, or \fBvariable\fR. @@ -40,7 +40,8 @@ one or more of the following items: \fBrename\fR Invoke \fIcommand\fR whenever the command is renamed. Note that renaming to the empty string is considered deletion, and will not -be traced with '\fBrename\fR'. +be traced with +.QW rename . .TP \fBdelete\fR Invoke \fIcommand\fR when the command is deleted. Commands can be @@ -57,7 +58,9 @@ command is as follows: .CE \fIOldName\fR and \fInewName\fR give the traced command's current (old) name, and the name to which it is being renamed (the empty -string if this is a 'delete' operation). +string if this is a +.QW delete +operation). \fIOp\fR indicates what operation is being performed on the command, and is one of \fBrename\fR or \fBdelete\fR as defined above. The trace operation cannot be used to stop a command @@ -123,7 +126,8 @@ all arguments in their fully expanded form. command execution, and is one of \fBenter\fR or \fBenterstep\fR as defined above. The trace operation can be used to stop the command from executing, by deleting the command in question. Of -course when the command is subsequently executed, an 'invalid command' +course when the command is subsequently executed, an +.QW "invalid command" error will occur. .PP For \fBleave\fR and \fBleavestep\fR operations: |