From 8a45c3faf392af5c64589268d0d7699c17b7feec Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 15 Nov 2012 17:55:25 +0000 Subject: More complete purge of things only present for supporting long-dead Mac 9 systems. --- compat/string.h | 2 - doc/Init.3 | 4 +- doc/Macintosh.3 | 109 --------- doc/OpenFileChnl.3 | 3 +- doc/OpenTcp.3 | 3 +- doc/SourceRCFile.3 | 4 - doc/exec.n | 3 - doc/fconfigure.n | 4 +- doc/file.n | 20 +- doc/filename.n | 57 +---- doc/glob.n | 15 +- doc/open.n | 6 - doc/puts.n | 3 +- doc/resource.n | 154 ------------- doc/source.n | 8 - doc/tclvars.n | 72 +----- generic/README | 4 +- generic/tcl.h | 45 +--- generic/tclAlloc.c | 2 +- generic/tclBasic.c | 14 -- generic/tclCmdAH.c | 7 +- generic/tclDate.c | 12 +- generic/tclExecute.c | 2 +- generic/tclFileName.c | 579 +----------------------------------------------- generic/tclGet.c | 2 +- generic/tclGetDate.y | 12 +- generic/tclIOCmd.c | 16 -- generic/tclIOUtil.c | 53 +---- generic/tclInt.h | 22 +- generic/tclMain.c | 4 - generic/tclMath.h | 6 +- generic/tclNotify.c | 2 +- generic/tclPort.h | 6 +- generic/tclStubInit.c | 12 +- generic/tclTest.c | 7 - generic/tclThreadJoin.c | 4 +- library/init.tcl | 8 - library/package.tcl | 3 +- tests/all.tcl | 4 - tests/binary.test | 11 - tests/cmdAH.test | 263 +--------------------- tests/cmdMZ.test | 6 - tests/fCmd.test | 55 +---- tests/fileName.test | 577 +---------------------------------------------- tests/interp.test | 26 +-- tests/io.test | 12 +- tests/load.test | 6 - tests/macFCmd.test | 200 ----------------- tests/osa.test | 46 ---- tests/resource.test | 363 ------------------------------ tests/socket.test | 10 +- tests/source.test | 104 --------- unix/Makefile.in | 14 -- unix/README | 3 +- win/tcl.dsp | 8 - 55 files changed, 64 insertions(+), 2933 deletions(-) delete mode 100644 doc/Macintosh.3 delete mode 100644 doc/resource.n delete mode 100644 tests/macFCmd.test delete mode 100644 tests/osa.test delete mode 100644 tests/resource.test diff --git a/compat/string.h b/compat/string.h index fbf9cf8..4eb2b86 100644 --- a/compat/string.h +++ b/compat/string.h @@ -22,9 +22,7 @@ * it exists everywhere) */ -#ifndef MAC_TCL #include -#endif #ifdef __APPLE__ extern VOID * memchr _ANSI_ARGS_((CONST VOID *s, int c, size_t n)); diff --git a/doc/Init.3 b/doc/Init.3 index e78423e..fdc66c7 100644 --- a/doc/Init.3 +++ b/doc/Init.3 @@ -22,9 +22,7 @@ Interpreter to initialize. .PP \fBTcl_Init\fR is a helper procedure that finds and \fBsource\fR's the \fBinit.tcl\fR script, which should exist somewhere on the Tcl library -path. On Macintosh systems, it additionally checks for an \fBInit\fR -resource and sources the contents of that resource if \fBinit.tcl\fR -cannot be found. +path. .PP \fBTcl_Init\fR is typically called from \fBTcl_AppInit\fR procedures. diff --git a/doc/Macintosh.3 b/doc/Macintosh.3 deleted file mode 100644 index cd97578..0000000 --- a/doc/Macintosh.3 +++ /dev/null @@ -1,109 +0,0 @@ -'\" -'\" Copyright (c) 1997-1998 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -.so man.macros -.TH Tcl_MacSetEventProc 3 "8.1" Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_MacSetEventProc, Tcl_MacConvertTextResource, Tcl_MacEvalResource, Tcl_MacFindResource, Tcl_GetOSTypeFromObj, Tcl_SetOSTypeObj, Tcl_NewOSTypeObj \- procedures to handle Macintosh resources and other Macintosh specifics -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -int -\fBTcl_MacEvalResource\fR(\fIinterp, resourceName, resourceNumber, fileName\fR) -.sp -char* -\fBTcl_MacConvertTextResource\fR(\fIresource\fR) -.sp -Handle -\fBTcl_MacFindResource\fR(\fIinterp, resourceType, resourceName, resourceNumber, resFileRef, releaseIt\fR) -.sp -Tcl_Obj* -\fBTcl_NewOSTypeObj\fR(\fInewOSType\fR) -.sp -void -\fBTcl_SetOSTypeObj\fR(\fIobjPtr, newOSType\fR) -.sp -int -\fBTcl_GetOSTypeFromObj\fR(\fIinterp, objPtr, osTypePtr\fR) -.sp -void -\fBTcl_MacSetEventProc\fR(\fIprocPtr\fR) -.SH ARGUMENTS -.AP Tcl_Interp *interp in -Interpreter to use for error reporting, or NULL if no error reporting is -desired. -.AP "CONST char" *resourceName in -Name of TEXT resource to source, NULL if number should be used. -.AP int resourceNumber in -Resource id of source. -.AP "CONST char" *fileName in -Name of file to process. NULL if application resource. -.AP Handle resource in -Handle to TEXT resource. -.AP long resourceType in -Type of resource to load. -.AP "CONST char" *resFileRef in -Registered resource file reference, NULL if searching all open resource files. -.AP int *releaseIt out -Should we release this resource when done. -.AP int newOSType in -Int used to initialize the new object or set the object's value. -.AP Tcl_Obj *objPtr in -Object whose internal representation is to be set or retrieved. -.AP osTypePtr out -Place to store the resulting integer. -.AP Tcl_MacConvertEventPtr procPtr in -Reference to the new function to handle all incoming Mac events. - -.BE -.SH INTRODUCTION -.PP -The described routines are used to implement the Macintosh specific -\fBresource\fR command and the Mac specific notifier.. They manipulate -or use Macintosh resources and provide administration for open -resource file references. - -.SH DESCRIPTION -.PP -\fBTcl_MacEvalResource\fR extends the \fBsource\fR command to -Macintosh resources. It sources Tcl code from a Text resource. -Currently only sources the resource by name, file IDs may be supported -at a later date. -.PP -\fBTcl_MacConvertTextResource\fR converts a TEXT resource into a Tcl -suitable string. It mallocs the returned memory, converts ``\\r'' to -``\\n'', and appends a null. The caller has the responsibility for -freeing the memory. -.PP -\fBTcl_MacFindResource\fR provides a higher level interface for -loading resources. It is used by \fBresource read\fR. -.PP -\fBTcl_NewOSTypeObj\fR is used to create a new resource name type -object. The object type is "ostype". -.PP -\fBTcl_SetOSTypeObj\fR modifies an object to be a resource type and to -have the specified long value. -.PP -\fBTcl_GetOSTypeFromObj\fR attempts to return an int from the Tcl -object "objPtr". If the object is not already an int, an attempt will -be made to convert it to one. -.PP -\fBTcl_MacSetEventProc\fR sets the event handling procedure for the -application. This function will be passed all incoming Mac events. -This function usually controls the console or some other entity like -Tk. - -.SH RESOURCE TYPES -.PP -Resource types are 4-byte values used by the macintosh resource -facility to tag parts of the resource fork in a file so that the OS -knows how to handle them. As all 4 bytes are restricted to printable -characters such a type can be interpreted as a 4 character string too. - -.SH KEYWORDS -macintosh, mac, resource, notifier diff --git a/doc/OpenFileChnl.3 b/doc/OpenFileChnl.3 index 80596d7..33c57fa 100644 --- a/doc/OpenFileChnl.3 +++ b/doc/OpenFileChnl.3 @@ -673,8 +673,7 @@ call. On Windows platforms, the handle is a file \fBHANDLE\fR when the channel was created with \fBTcl_OpenFileChannel\fR, \fBTcl_OpenCommandChannel\fR, or \fBTcl_MakeFileChannel\fR. Other channel types may return a different type of handle on Windows -platforms. On the Macintosh platform, the handle is a file reference -number as returned from \fBHOpenDF\fR. +platforms. .SH "SEE ALSO" DString(3), fconfigure(n), filename(n), fopen(3), Tcl_CreateChannel(3) diff --git a/doc/OpenTcp.3 b/doc/OpenTcp.3 index 4ddb8a7..df14f44 100644 --- a/doc/OpenTcp.3 +++ b/doc/OpenTcp.3 @@ -167,8 +167,7 @@ replacement for the standard channel. .PP On Unix platforms, the socket handle is a Unix file descriptor as returned by the \fBsocket\fR system call. On the Windows platform, the -socket handle is a \fBSOCKET\fR as defined in the WinSock API. On the -Macintosh platform, the socket handle is a \fBStreamPtr\fR. +socket handle is a \fBSOCKET\fR as defined in the WinSock API. .VE .SH "SEE ALSO" diff --git a/doc/SourceRCFile.3 b/doc/SourceRCFile.3 index ed949cd..5eb5472 100644 --- a/doc/SourceRCFile.3 +++ b/doc/SourceRCFile.3 @@ -26,10 +26,6 @@ sourced is obtained from the global variable \fBtcl_rcFileName\fR in the interpreter given by \fIinterp\fR. If this variable is not defined, or if the file it indicates cannot be found, no action is taken. -.PP -On the Macintosh, after sourcing the rc file, this function will -additionally source the TEXT resource indicated by the global variable -\fBtcl_rcRsrcName\fR in \fIinterp\fR. .SH KEYWORDS application-specific initialization, main program, rc file diff --git a/doc/exec.n b/doc/exec.n index 3f85fd6..c5a2307 100644 --- a/doc/exec.n +++ b/doc/exec.n @@ -315,9 +315,6 @@ output may fail, hang Tcl, or even hang the system if their own private console window is not available to them. .RE .TP -\fBMacintosh\fR -The \fBexec\fR command is not implemented and does not exist under Macintosh. -.TP \fBUnix\fR\0\0\0\0\0\0\0 The \fBexec\fR command is fully functional and works as described. diff --git a/doc/fconfigure.n b/doc/fconfigure.n index 11a4c4f..19c8a61 100644 --- a/doc/fconfigure.n +++ b/doc/fconfigure.n @@ -151,8 +151,8 @@ newline (\fBcrlf\fP) as the end of line representation. The end of line representation can even change from line-to-line, and all cases are translated to a newline. As the output translation mode, \fBauto\fR chooses a platform specific representation; for sockets on all platforms -Tcl chooses \fBcrlf\fR, for all Unix flavors, it chooses \fBlf\fR, for the -Macintosh platform it chooses \fBcr\fR and for the various flavors of +Tcl chooses \fBcrlf\fR, for all Unix flavors, it chooses \fBlf\fR and for +the various flavors of Windows it chooses \fBcrlf\fR. The default setting for \fB\-translation\fR is \fBauto\fR for both input and output. .TP diff --git a/doc/file.n b/doc/file.n index bc9eccc..6aeec52 100644 --- a/doc/file.n +++ b/doc/file.n @@ -67,13 +67,6 @@ 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 clears the value of the system attribute of the file. -.PP -On Macintosh, \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. Note that directories can only be locked if -File Sharing is turned on. \fB-type\fR gives or sets the Finder file -type for the file. .RE .VS .TP @@ -126,8 +119,8 @@ a \fB\-\fR. \fBfile dirname \fIname\fR Returns a name comprised of all of the path components in \fIname\fR excluding the last element. If \fIname\fR is a relative file name and -only contains one path element, then returns ``\fB.\fR'' (or ``\fB:\fR'' -on the Macintosh). If \fIname\fR refers to a root directory, then the +only contains one path element, then returns ``\fB.\fR''. +If \fIname\fR refers to a root directory, then the root directory is returned. For example, .RS .CS @@ -186,7 +179,7 @@ returns \fB/foo/bar\fR. .PP Note that any of the names can contain separators, and that the result is always canonical for the current platform: \fB/\fR for Unix and -Windows, and \fB:\fR for Macintosh. +Windows. .RE .TP \fBfile link ?\fI-linktype\fR? \fIlinkName\fR ?\fItarget\fR? @@ -251,7 +244,7 @@ or set then an error is generated. . Returns the platform-specific name of the file. This is useful if the filename is needed to pass to a platform-specific call, such as exec -under Windows or AppleScript on the Macintosh. +under Windows. .TP \fBfile normalize \fIname\fR . @@ -398,10 +391,7 @@ Returns a string giving the type of file \fIname\fR, which will be one of \fBfile volumes\fR . Returns the absolute paths to the volumes mounted on the system, as a -proper Tcl list. On the Macintosh, this will be a list of the mounted -drives, both local and network. N.B. if two drives have the same name, -they will both appear on the volume list, but there is currently no way, -from Tcl, to access any but the first of these drives. On UNIX, the +proper Tcl list. 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:/}). diff --git a/doc/filename.n b/doc/filename.n index b588440..92d0eb7 100644 --- a/doc/filename.n +++ b/doc/filename.n @@ -42,61 +42,6 @@ type of a given path. The rules for native names depend on the value reported in the Tcl array element \fBtcl_platform(platform)\fR: .TP 10 -\fBmac\fR -On Apple Macintosh systems, Tcl supports two forms of path names. The -normal Mac style names use colons as path separators. Paths may be -relative or absolute, and file names may contain any character other -than colon. A leading colon causes the rest of the path to be -interpreted relative to the current directory. If a path contains a -colon that is not at the beginning, then the path is interpreted as an -absolute path. Sequences of two or more colons anywhere in the path -are used to construct relative paths where \fB::\fR refers to the -parent of the current directory, \fB:::\fR refers to the parent of the -parent, and so forth. -.RS -.PP -In addition to Macintosh style names, Tcl also supports a subset of -Unix-like names. If a path contains no colons, then it is interpreted -like a Unix path. Slash is used as the path separator. The file name -\fB\&.\fR refers to the current directory, and \fB\&..\fR refers to the -parent of the current directory. However, some names like \fB/\fR or -\fB/..\fR have no mapping, and are interpreted as Macintosh names. In -general, commands that generate file names will return Macintosh style -names, but commands that accept file names will take both Macintosh -and Unix-style names. -.PP -The following examples illustrate various forms of path names: -.TP 15 -\fB:\fR -Relative path to the current folder. -.TP 15 -\fBMyFile\fR -Relative path to a file named \fBMyFile\fR in the current folder. -.TP 15 -\fBMyDisk:MyFile\fR -Absolute path to a file named \fBMyFile\fR on the device named \fBMyDisk\fR. -.TP 15 -\fB:MyDir:MyFile\fR -Relative path to a file name \fBMyFile\fR in a folder named -\fBMyDir\fR in the current folder. -.TP 15 -\fB::MyFile\fR -Relative path to a file named \fBMyFile\fR in the folder above the -current folder. -.TP 15 -\fB:::MyFile\fR -Relative path to a file named \fBMyFile\fR in the folder two levels above the -current folder. -.TP 15 -\fB/MyDisk/MyFile\fR -Absolute path to a file named \fBMyFile\fR on the device named -\fBMyDisk\fR. -.TP 15 -\fB\&../MyFile\fR -Relative path to a file named \fBMyFile\fR in the folder above the -current folder. -.RE -.TP \fBunix\fR On Unix platforms, Tcl uses path names where the components are separated by slashes. Path names may be relative or absolute, and @@ -182,7 +127,7 @@ characters between the tilde and the next separator are taken as a user name, which is used to retrieve the user's home directory for substitution. .PP -The Macintosh and Windows platforms do not support tilde substitution +The Windows platform does not support tilde substitution when a user name follows the tilde. On these platforms, attempts to use a tilde followed by a user name will generate an error that the user does not exist when Tcl attempts to interpret that part of the diff --git a/doc/glob.n b/doc/glob.n index 6f45d90..1a08c7a 100644 --- a/doc/glob.n +++ b/doc/glob.n @@ -83,13 +83,7 @@ a directory will be returned if \fB\-types d\fR was specified. .PP The second form specifies types where all the types given must match. These are \fIr\fR, \fIw\fR, \fIx\fR as file permissions, and -\fIreadonly\fR, \fIhidden\fR as special permission cases. On the -Macintosh, MacOS types and creators are also supported, where any item -which is four characters long is assumed to be a MacOS type -(e.g. \fBTEXT\fR). Items which are of the form \fI{macintosh type XXXX}\fR -or \fI{macintosh creator XXXX}\fR will match types or creators -respectively. Unrecognized types, or specifications of multiple MacOS -types/creators will signal an error. +\fIreadonly\fR, \fIhidden\fR as special permission cases. .PP The two forms may be mixed, so \fB\-types {d f r w}\fR will find all regular files OR directories that have both read AND write permissions. @@ -184,13 +178,6 @@ interpreted as a wildcard character. One solution to this problem is to use the Unix style forward slash as a path separator. Windows style paths can be converted to Unix style paths with the command \fBfile join $path\fR (or \fBfile normalize $path\fR in Tcl 8.4). -.TP -\fBMacintosh\fR -. -When using the options, \fB\-directory\fR, \fB\-join\fR or \fB\-path\fR, glob -assumes the directory separator for the entire pattern is the standard -``:''. When not using these options, glob examines each pattern argument -and uses ``/'' unless the pattern contains a ``:''. .SH EXAMPLES Find all the Tcl files in the current directory: .CS diff --git a/doc/open.n b/doc/open.n index 1557ca9..ae0bcbc 100644 --- a/doc/open.n +++ b/doc/open.n @@ -378,12 +378,6 @@ application, no data will be sent to the command pipeline's standard output until the pipe is actually closed. This problem occurs because 16-bit DOS applications are run synchronously, as described above. .TP -\fBMacintosh\fR -Opening a serial port is not currently implemented under Macintosh. -.sp -Opening a command pipeline is not supported under Macintosh, since -applications do not support the concept of standard input or output. -.TP \fBUnix\fR\0\0\0\0\0\0\0 Valid values for \fIfileName\fR to open a serial port are generally of the form \fB/dev/tty\fIX\fR, where \fIX\fR is \fBa\fR or \fBb\fR, but the name diff --git a/doc/puts.n b/doc/puts.n index 9fa5f15..5c1c12c 100644 --- a/doc/puts.n +++ b/doc/puts.n @@ -37,8 +37,7 @@ Newline characters in the output are translated by \fBputs\fR to platform-specific end-of-line sequences according to the current value of the \fB\-translation\fR option for the channel (for example, on PCs newlines are normally replaced with carriage-return-linefeed -sequences; on Macintoshes newlines are normally replaced with -carriage-returns). +sequences). See the \fBfconfigure\fR manual entry for a discussion on ways in which \fBfconfigure\fR will alter output. .PP diff --git a/doc/resource.n b/doc/resource.n deleted file mode 100644 index d8d2fbf..0000000 --- a/doc/resource.n +++ /dev/null @@ -1,154 +0,0 @@ -'\" -'\" Copyright (c) 1997 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -.so man.macros -.TH resource n 8.0 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -resource \- Manipulate Macintosh resources -.SH SYNOPSIS -\fBresource \fIoption\fR ?\fIarg arg ...\fR? -.BE - -.SH DESCRIPTION -.PP -The \fBresource\fR command provides some generic operations for -dealing with Macintosh resources. This command is only supported on -the Macintosh platform. Each Macintosh file consists of two -\fIforks\fR: a \fIdata\fR fork and a \fIresource\fR fork. You use the -normal open, puts, close, etc. commands to manipulate the data fork. -You must use this command, however, to interact with the resource -fork. \fIOption\fR indicates what resource command to perform. Any -unique abbreviation for \fIoption\fR is acceptable. The valid options -are: -.TP -\fBresource close \fIrsrcRef\fR -Closes the given resource reference (obtained from \fBresource -open\fR). Resources from that resource file will no longer be -available. -.TP -\fBresource delete\fR ?\fIoptions\fR? \fIresourceType\fR -This command will delete the resource specified by \fIoptions\fR and -type \fIresourceType\fR (see RESOURCE TYPES below). The options -give you several ways to specify the resource to be deleted. -.RS -.TP -\fB\-id\fR \fIresourceId\fR -If the \fB-id\fR option is given the id \fIresourceId\fR (see RESOURCE -IDS below) is used to specify the resource to be deleted. The id must -be a number - to specify a name use the \fB\-name\fR option. -.TP -\fB\-name\fR \fIresourceName\fR -If \fB-name\fR is specified, the resource named -\fIresourceName\fR will be deleted. If the \fB-id\fR is also -provided, then there must be a resource with BOTH this name and -this id. If no name is provided, then the id will be used regardless -of the name of the actual resource. -.TP -\fB\-file\fR \fIresourceRef\fR -If the \fB-file\fR option is specified then the resource will be -deleted from the file pointed to by \fIresourceRef\fR. Otherwise the -first resource with the given \fIresourceName\fR and or -\fIresourceId\fR which is found on the resource file path will be -deleted. To inspect the file path, use the \fIresource files\fR command. -.RE -.TP -\fBresource files ?\fIresourceRef\fR? -If \fIresourceRef\fRis not provided, this command returns a Tcl list -of the resource references for all the currently open resource files. -The list is in the normal Macintosh search order for resources. If -\fIresourceRef\fR is specified, the command will -return the path to the file whose resource fork is represented by that -token. -.TP -\fBresource list \fIresourceType\fR ?\fIresourceRef\fR? -List all of the resources ids of type \fIresourceType\fR (see RESOURCE -TYPES below). If \fIresourceRef\fR is specified then the command will -limit the search to that particular resource file. Otherwise, all -resource files currently opened by the application will be searched. -A Tcl list of either the resource name's or resource id's of the found -resources will be returned. See the RESOURCE IDS section below for -more details about what a resource id is. -.TP -\fBresource open \fIfileName\fR ?\fIaccess\fR? -Open the resource for the file \fIfileName\fR. Standard file access -permissions may also be specified (see the manual entry for \fBopen\fR -for details). A resource reference (\fIresourceRef\fR) is returned -that can be used by the other resource commands. An error can occur -if the file doesn't exist or the file does not have a resource fork. -However, if you open the file with write permissions the file and/or -resource fork will be created instead of generating an error. -.TP -\fBresource read \fIresourceType\fR \fIresourceId\fR ?\fIresourceRef\fR? -Read the entire resource of type \fIresourceType\fR (see RESOURCE -TYPES below) and the name or id of \fIresourceId\fR (see RESOURCE IDS -below) into memory and return the result. If \fIresourceRef\fR is -specified we limit our search to that resource file, otherwise we -search all open resource forks in the application. It is important to -note that most Macintosh resource use a binary format and the data -returned from this command may have embedded NULLs or other non-ASCII -data. -.TP -\fBresource types ?\fIresourceRef\fR? -This command returns a Tcl list of all resource types (see RESOURCE -TYPES below) found in the resource file pointed to by -\fIresourceRef\fR. If \fIresourceRef\fR is not specified it will -return all the resource types found in every resource file currently -opened by the application. -.TP -\fBresource write\fR ?\fIoptions\fR? \fIresourceType\fR \fIdata\fR -This command will write the passed in \fIdata\fR as a new resource of -type \fIresourceType\fR (see RESOURCE TYPES below). Several options -are available that describe where and how the resource is stored. -.RS -.TP -\fB\-id\fR \fIresourceId\fR -If the \fB-id\fR option is given the id \fIresourceId\fR (see RESOURCE -IDS below) is used for the new resource, otherwise a unique id will be -generated that will not conflict with any existing resource. However, -the id must be a number - to specify a name use the \fB\-name\fR option. -.TP -\fB\-name\fR \fIresourceName\fR -If \fB-name\fR is specified the resource will be named -\fIresourceName\fR, otherwise it will have the empty string as the -name. -.TP -\fB\-file\fR \fIresourceRef\fR -If the \fB-file\fR option is specified then the resource will be -written in the file pointed to by \fIresourceRef\fR, otherwise the -most recently open resource will be used. -.TP -\fB\-force\fR -If the target resource already exists, then by default Tcl will not -overwrite it, but raise an error instead. Use the -force flag to -force overwriting the extant resource. -.RE - -.SH "RESOURCE TYPES" -Resource types are defined as a four character string that is then -mapped to an underlying id. For example, \fBTEXT\fR refers to the -Macintosh resource type for text. The type \fBSTR#\fR is a list of -counted strings. All Macintosh resources must be of some type. See -Macintosh documentation for a more complete list of resource types -that are commonly used. - -.SH "RESOURCE IDS" -For this command the notion of a resource id actually refers to two -ideas in Macintosh resources. Every place you can use a resource Id -you can use either the resource name or a resource number. Names are -always searched or returned in preference to numbers. For example, -the \fBresource list\fR command will return names if they exist or -numbers if the name is NULL. - -.SH "PORTABILITY ISSUES" -The resource command is only available on Macintosh. - -.SH "SEE ALSO" -open(n) - -.SH KEYWORDS -open, resource diff --git a/doc/source.n b/doc/source.n index 18004a8..c60c86e 100644 --- a/doc/source.n +++ b/doc/source.n @@ -40,14 +40,6 @@ If you require a ``^Z'' in code for string comparison, you can use ``\\032'' or ``\\u001a'', which will be safely substituted by the Tcl interpreter into ``^Z''. .VE 8.4 -.PP -The \fI\-rsrc\fR and \fI\-rsrcid\fR forms of this command are only -available on Macintosh computers. These versions of the command -allow you to source a script from a \fBTEXT\fR resource. You may specify -what \fBTEXT\fR resource to source by either name or id. By default Tcl -searches all open resource files, which include the current -application and any loaded C extensions. Alternatively, you may -specify the \fIfileName\fR where the \fBTEXT\fR resource can be found. .SH EXAMPLE Run the script in the file \fBfoo.tcl\fR and then the script in the file \fBbar.tcl\fR: diff --git a/doc/tclvars.n b/doc/tclvars.n index d097a92..b4cf9e2 100644 --- a/doc/tclvars.n +++ b/doc/tclvars.n @@ -45,65 +45,6 @@ Tcl are left unmodified. Setting an env array variable to blank is the same as unsetting it as this is the behavior of the underlying Windows OS. It should be noted that relying on an existing and empty environment variable won't work on windows and is discouraged for cross-platform usage. -.VE -.RE -.RS -On the Macintosh, the environment variable is constructed by Tcl as no -global environment variable exists. The environment variables that -are created for Tcl include: -.TP -\fBLOGIN\fR -This holds the Chooser name of the Macintosh. -.TP -\fBUSER\fR -This also holds the Chooser name of the Macintosh. -.TP -\fBSYS_FOLDER\fR -The path to the system directory. -.TP -\fBAPPLE_M_FOLDER\fR -The path to the Apple Menu directory. -.TP -\fBCP_FOLDER\fR -The path to the control panels directory. -.TP -\fBDESK_FOLDER\fR -The path to the desk top directory. -.TP -\fBEXT_FOLDER\fR -The path to the system extensions directory. -.TP -\fBPREF_FOLDER\fR -The path to the preferences directory. -.TP -\fBPRINT_MON_FOLDER\fR -The path to the print monitor directory. -.TP -\fBSHARED_TRASH_FOLDER\fR -The path to the network trash directory. -.TP -\fBTRASH_FOLDER\fR -The path to the trash directory. -.TP -\fBSTART_UP_FOLDER\fR -The path to the start up directory. -.TP -\fBHOME\fR -The path to the application's default directory. -.PP -You can also create your own environment variables for the Macintosh. -A file named \fITcl Environment Variables\fR may be placed in the -preferences folder in the Mac system folder. Each line of this file -should be of the form \fIVAR_NAME=var_data\fR. -.PP -The last alternative is to place environment variables in a 'STR#' -resource named \fITcl Environment Variables\fR of the application. This -is considered a little more ``Mac like'' than a Unix style Environment -Variable file. Each entry in the 'STR#' resource has the same format -as above. The source code file \fItclMacEnv.c\fR contains the -implementation of the env mechanisms. This file contains many -#define's that allow customization of the env mechanisms to fit your -applications needs. .RE .TP \fBerrorCode\fR @@ -279,7 +220,7 @@ Windows 95, the version will be 4.0; on Windows 98, the version will be 4.10. .TP \fBplatform\fR -Either \fBwindows\fR, \fBmacintosh\fR, or \fBunix\fR. This identifies the +Either \fBwindows\fR or \fBunix\fR. This identifies the general operating environment of the machine. .TP \fBthreaded\fR @@ -290,7 +231,7 @@ was compiled with threads enabled. This identifies the current user based on the login information available on the platform. This comes from the USER or LOGNAME environment variable on Unix, -and the value from GetUserName on Windows and Macintosh. +and the value from GetUserName on Windows. .TP \fBwordSize\fR .VS 8.4 @@ -326,15 +267,6 @@ of this file and \fBsource\fR it if it exists. For example, for \fBwish\fR the variable is set to \fB~/.wishrc\fR for Unix and \fB~/wishrc.tcl\fR for Windows. .TP -\fBtcl_rcRsrcName\fR -This variable is only used on Macintosh systems. The variable is used -during initialization to indicate the name of a user-specific -\fBTEXT\fR resource located in the application or extension resource -forks. If it is set by application-specific initialization, then the -Tcl startup code will check for the existence of this resource and -\fBsource\fR it if it exists. For example, the Macintosh \fBwish\fR -application has the variable is set to \fBtclshrc\fR. -.TP \fBtcl_traceCompile\fR The value of this variable can be set to control how much tracing information diff --git a/generic/README b/generic/README index ec6139a..3311690 100644 --- a/generic/README +++ b/generic/README @@ -1,3 +1,3 @@ This directory contains Tcl source files that work on all the platforms -where Tcl runs (e.g. UNIX, PCs, and Macintoshes). Platform-specific -sources are in the directories ../unix, ../win, ../macosx, and ../mac. +where Tcl runs (e.g. UNIX, PCs). Platform-specific +sources are in the directories ../unix, ../win, and ../macosx. diff --git a/generic/tcl.h b/generic/tcl.h index 3c6ef5e..36077e6 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -90,23 +90,6 @@ extern "C" { #endif /* __WIN32__ */ /* - * The following definitions set up the proper options for Macintosh - * compilers. We use this method because there is no autoconf equivalent. - */ - -#ifdef MAC_TCL -#include -# ifndef USE_TCLALLOC -# define USE_TCLALLOC 1 -# endif -# ifndef NO_STRERROR -# define NO_STRERROR 1 -# endif -# define INLINE -#endif - - -/* * Utility macros: STRINGIFY takes an argument and wraps it in "" (double * quotation marks), JOIN joins two arguments. */ @@ -121,9 +104,8 @@ extern "C" { /* * A special definition used to allow this header file to be included - * from windows or mac resource files so that they can obtain version - * information. RC_INVOKED is defined by default by the windows RC tool - * and manually set for macintosh. + * from windows resource files so that they can obtain version + * information. RC_INVOKED is defined by default by the windows RC tool. * * Resource compilers don't like all the C stuff, like typedefs and * procedure declarations, that occur below, so block them out. @@ -538,9 +520,7 @@ typedef struct Tcl_LoadHandle_ *Tcl_LoadHandle; * 'Tcl_CreateThread' and will be called as the main fuction of * the new thread created by that call. */ -#ifdef MAC_TCL -typedef pascal void *(Tcl_ThreadCreateProc) _ANSI_ARGS_((ClientData clientData)); -#elif defined __WIN32__ +#if defined __WIN32__ typedef unsigned (__stdcall Tcl_ThreadCreateProc) _ANSI_ARGS_((ClientData clientData)); #else typedef void (Tcl_ThreadCreateProc) _ANSI_ARGS_((ClientData clientData)); @@ -551,10 +531,7 @@ typedef void (Tcl_ThreadCreateProc) _ANSI_ARGS_((ClientData clientData)); * differences when writing a Tcl_ThreadCreateProc. See the NewThread * function in generic/tclThreadTest.c for it's usage. */ -#ifdef MAC_TCL -# define Tcl_ThreadCreateType pascal void * -# define TCL_THREAD_CREATE_RETURN return NULL -#elif defined __WIN32__ +#ifdef __WIN32__ # define Tcl_ThreadCreateType unsigned __stdcall # define TCL_THREAD_CREATE_RETURN return 0 #else @@ -1433,7 +1410,6 @@ typedef enum { * The following structure keeps is used to hold a time value, either as * an absolute time (the number of seconds from the epoch) or as an * elapsed time. On Unix systems the epoch is Midnight Jan 1, 1970 GMT. - * On Macintosh systems the epoch is Midnight Jan 1, 1904 GMT. */ typedef struct Tcl_Time { @@ -2366,20 +2342,7 @@ EXTERN CONST char * Tcl_InitStubs _ANSI_ARGS_((Tcl_Interp *interp, * accessible via the stubs table. */ -/* - * tclPlatDecls.h can't be included here on the Mac, as we need - * Mac specific headers to define the Mac types used in this file, - * but these Mac haders conflict with a number of tk types - * and thus can't be included in the globally read tcl.h - * This header was originally added here as a fix for bug 5241 - * (stub link error for symbols in TclPlatStubs table), as a work- - * around for the bug on the mac, tclMac.h is included immediately - * after tcl.h in the tcl precompiled header (with DLLEXPORT set). - */ - -#if !defined(MAC_TCL) #include "tclPlatDecls.h" -#endif /* * Public functions that are not accessible via the stubs table. diff --git a/generic/tclAlloc.c b/generic/tclAlloc.c index 7b9c807..5967201 100644 --- a/generic/tclAlloc.c +++ b/generic/tclAlloc.c @@ -32,7 +32,7 @@ * We should really make use of AC_CHECK_TYPE(caddr_t) * here, but it can wait until Tcl uses config.h properly. */ -#if defined(MAC_TCL) || defined(_MSC_VER) || defined(__MINGW32__) || defined(__BORLANDC__) +#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__BORLANDC__) typedef unsigned long caddr_t; #endif diff --git a/generic/tclBasic.c b/generic/tclBasic.c index c738916..bd4ad5d 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -242,24 +242,10 @@ static CONST CmdInfo builtInCmds[] = { (CompileProc *) NULL, 1}, {"vwait", (Tcl_CmdProc *) NULL, Tcl_VwaitObjCmd, (CompileProc *) NULL, 1}, - -#ifdef MAC_TCL - {"beep", (Tcl_CmdProc *) NULL, Tcl_BeepObjCmd, - (CompileProc *) NULL, 0}, - {"echo", Tcl_EchoCmd, (Tcl_ObjCmdProc *) NULL, - (CompileProc *) NULL, 0}, - {"ls", (Tcl_CmdProc *) NULL, Tcl_LsObjCmd, - (CompileProc *) NULL, 0}, - {"resource", (Tcl_CmdProc *) NULL, Tcl_ResourceObjCmd, - (CompileProc *) NULL, 1}, - {"source", (Tcl_CmdProc *) NULL, Tcl_MacSourceObjCmd, - (CompileProc *) NULL, 0}, -#else {"exec", (Tcl_CmdProc *) NULL, Tcl_ExecObjCmd, (CompileProc *) NULL, 0}, {"source", (Tcl_CmdProc *) NULL, Tcl_SourceObjCmd, (CompileProc *) NULL, 0}, -#endif /* MAC_TCL */ #endif /* TCL_GENERIC_ONLY */ {NULL, (Tcl_CmdProc *) NULL, (Tcl_ObjCmdProc *) NULL, diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index 45e138c..2f7814c 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -1168,11 +1168,11 @@ Tcl_FileObjCmd(dummy, interp, objc, objv) value = 0; if (GetStatBuf(NULL, objv[2], Tcl_FSStat, &buf) == TCL_OK) { /* - * For Windows and Macintosh, there are no user ids + * For Windows there are no user ids * associated with a file, so we always return 1. */ -#if defined(__WIN32__) || defined(MAC_TCL) || defined(__CYGWIN__) +#if defined(__WIN32__) || defined(__CYGWIN__) value = 1; #else value = (geteuid() == buf.st_uid); @@ -1262,9 +1262,6 @@ Tcl_FileObjCmd(dummy, interp, objc, objv) case TCL_PLATFORM_WINDOWS: separator = "\\"; break; - case TCL_PLATFORM_MAC: - separator = ":"; - break; } Tcl_SetObjResult(interp, Tcl_NewStringObj(separator,1)); } else { diff --git a/generic/tclDate.c b/generic/tclDate.c index b64a792..0475e58 100644 --- a/generic/tclDate.c +++ b/generic/tclDate.c @@ -14,15 +14,9 @@ #include "tclInt.h" #include "tclPort.h" -#if defined(MAC_TCL) && !defined(TCL_MAC_USE_MSL_EPOCH) -# define EPOCH 1904 -# define START_OF_TIME 1904 -# define END_OF_TIME 2039 -#else -# define EPOCH 1970 -# define START_OF_TIME 1902 -# define END_OF_TIME 2037 -#endif +#define EPOCH 1970 +#define START_OF_TIME 1902 +#define END_OF_TIME 2037 /* * The offset of tm_year of struct tm returned by localtime, gmtime, etc. diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 3ca1b63..2a9f8bb 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -16,7 +16,7 @@ #include "tclCompile.h" #ifndef TCL_NO_MATH -# include "tclMath.h" +# include #endif /* diff --git a/generic/tclFileName.c b/generic/tclFileName.c index c5ecf0f..046eaef 100644 --- a/generic/tclFileName.c +++ b/generic/tclFileName.c @@ -16,51 +16,9 @@ #include "tclPort.h" #include "tclRegexp.h" -/* - * This define is used to activate Tcl's interpretation of Unix-style - * paths (containing forward slashes, '.' and '..') on MacOS. A - * side-effect of this is that some paths become ambiguous. - */ -#define MAC_UNDERSTANDS_UNIX_PATHS - -#ifdef MAC_UNDERSTANDS_UNIX_PATHS -/* - * The following regular expression matches the root portion of a Macintosh - * absolute path. It will match degenerate Unix-style paths, tilde paths, - * Unix-style paths, and Mac paths. The various subexpressions in this - * can be summarised as follows: ^(/..|~user/unix|~user:mac|/unix|mac:dir). - * The subexpression indices which match the root portions, are as follows: - * - * degenerate unix-style: 2 - * unix-tilde: 5 - * mac-tilde: 7 - * unix-style: 9 (or 10 to cut off the irrelevant header). - * mac: 12 - * - */ - -#define MAC_ROOT_PATTERN "^((/+([.][.]?/+)*([.][.]?)?)|(~[^:/]*)(/[^:]*)?|(~[^:]*)(:.*)?|/+([.][.]?/+)*([^:/]+)(/[^:]*)?|([^:]+):.*)$" - -/* - * The following variables are used to hold precompiled regular expressions - * for use in filename matching. - */ - -typedef struct ThreadSpecificData { - int initialized; - Tcl_Obj *macRootPatternPtr; -} ThreadSpecificData; - -static Tcl_ThreadDataKey dataKey; - -static void FileNameCleanup _ANSI_ARGS_((ClientData clientData)); -static void FileNameInit _ANSI_ARGS_((void)); - -#endif - /* * The following variable is set in the TclPlatformInit call to one - * of: TCL_PLATFORM_UNIX, TCL_PLATFORM_MAC, or TCL_PLATFORM_WINDOWS. + * of: TCL_PLATFORM_UNIX, or TCL_PLATFORM_WINDOWS. */ TclPlatformType tclPlatform = TCL_PLATFORM_UNIX; @@ -76,64 +34,8 @@ static CONST char * ExtractWinRoot _ANSI_ARGS_((CONST char *path, Tcl_PathType *typePtr)); static int SkipToChar _ANSI_ARGS_((char **stringPtr, char *match)); -static Tcl_Obj* SplitMacPath _ANSI_ARGS_((CONST char *path)); static Tcl_Obj* SplitWinPath _ANSI_ARGS_((CONST char *path)); static Tcl_Obj* SplitUnixPath _ANSI_ARGS_((CONST char *path)); -#ifdef MAC_UNDERSTANDS_UNIX_PATHS - -/* - *---------------------------------------------------------------------- - * - * FileNameInit -- - * - * This procedure initializes the patterns used by this module. - * - * Results: - * None. - * - * Side effects: - * Compiles the regular expressions. - * - *---------------------------------------------------------------------- - */ - -static void -FileNameInit() -{ - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - if (!tsdPtr->initialized) { - tsdPtr->initialized = 1; - tsdPtr->macRootPatternPtr = Tcl_NewStringObj(MAC_ROOT_PATTERN, -1); - Tcl_CreateThreadExitHandler(FileNameCleanup, NULL); - } -} - -/* - *---------------------------------------------------------------------- - * - * FileNameCleanup -- - * - * This procedure is a Tcl_ExitProc used to clean up the static - * data structures used in this file. - * - * Results: - * None. - * - * Side effects: - * Deallocates storage used by the procedures in this file. - * - *---------------------------------------------------------------------- - */ - -static void -FileNameCleanup(clientData) - ClientData clientData; /* Not used. */ -{ - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - Tcl_DecrRefCount(tsdPtr->macRootPatternPtr); - tsdPtr->initialized = 0; -} -#endif /* *---------------------------------------------------------------------- @@ -411,87 +313,6 @@ TclpGetNativePathType(pathObjPtr, driveNameLengthPtr, driveNameRef) } break; } - case TCL_PLATFORM_MAC: - if (path[0] == ':') { - type = TCL_PATH_RELATIVE; - } else { -#ifdef MAC_UNDERSTANDS_UNIX_PATHS - ThreadSpecificData *tsdPtr; - Tcl_RegExp re; - - tsdPtr = TCL_TSD_INIT(&dataKey); - - /* - * Since we have eliminated the easy cases, use the - * root pattern to look for the other types. - */ - - FileNameInit(); - re = Tcl_GetRegExpFromObj(NULL, tsdPtr->macRootPatternPtr, - REG_ADVANCED); - - if (!Tcl_RegExpExec(NULL, re, path, path)) { - type = TCL_PATH_RELATIVE; - } else { - CONST char *root, *end; - Tcl_RegExpRange(re, 2, &root, &end); - if (root != NULL) { - type = TCL_PATH_RELATIVE; - } else { - if (driveNameLengthPtr != NULL) { - Tcl_RegExpRange(re, 0, &root, &end); - *driveNameLengthPtr = end - root; - } - if (driveNameRef != NULL) { - if (*root == '/') { - char *c; - int gotColon = 0; - *driveNameRef = Tcl_NewStringObj(root + 1, - end - root -1); - c = Tcl_GetString(*driveNameRef); - while (*c != '\0') { - if (*c == '/') { - gotColon++; - *c = ':'; - } - c++; - } - /* - * If there is no colon, we have just a - * volume name so we must add a colon so - * it is an absolute path. - */ - if (gotColon == 0) { - Tcl_AppendToObj(*driveNameRef, ":", 1); - } else if ((gotColon > 1) && - (*(c-1) == ':')) { - /* We have an extra colon */ - Tcl_SetObjLength(*driveNameRef, - c - Tcl_GetString(*driveNameRef) - 1); - } - } - } - } - } -#else - if (path[0] == '~') { - } else if (path[0] == ':') { - type = TCL_PATH_RELATIVE; - } else { - char *colonPos = strchr(path,':'); - if (colonPos == NULL) { - type = TCL_PATH_RELATIVE; - } else { - } - } - if (type == TCL_PATH_ABSOLUTE) { - if (driveNameLengthPtr != NULL) { - *driveNameLengthPtr = strlen(path); - } - } -#endif - } - break; case TCL_PLATFORM_WINDOWS: { Tcl_DString ds; @@ -559,9 +380,6 @@ TclpNativeSplitPath(pathPtr, lenPtr) resultPtr = SplitWinPath(Tcl_GetString(pathPtr)); break; - case TCL_PLATFORM_MAC: - resultPtr = SplitMacPath(Tcl_GetString(pathPtr)); - break; } /* @@ -821,246 +639,6 @@ SplitWinPath(path) } /* - *---------------------------------------------------------------------- - * - * SplitMacPath -- - * - * This routine is used by Tcl_(FS)SplitPath to handle splitting - * Macintosh paths. - * - * Results: - * Returns a newly allocated Tcl list object. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static Tcl_Obj* -SplitMacPath(path) - CONST char *path; /* Pointer to string containing a path. */ -{ - int isMac = 0; /* 1 if is Mac-style, 0 if Unix-style path. */ - int length; - CONST char *p, *elementStart; - Tcl_Obj *result; -#ifdef MAC_UNDERSTANDS_UNIX_PATHS - Tcl_RegExp re; - int i; - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); -#endif - - result = Tcl_NewObj(); - -#ifdef MAC_UNDERSTANDS_UNIX_PATHS - /* - * Initialize the path name parser for Macintosh path names. - */ - - FileNameInit(); - - /* - * Match the root portion of a Mac path name. - */ - - i = 0; /* Needed only to prevent gcc warnings. */ - - re = Tcl_GetRegExpFromObj(NULL, tsdPtr->macRootPatternPtr, REG_ADVANCED); - - if (Tcl_RegExpExec(NULL, re, path, path) == 1) { - CONST char *start, *end; - Tcl_Obj *nextElt; - - /* - * Treat degenerate absolute paths like / and /../.. as - * Mac relative file names for lack of anything else to do. - */ - - Tcl_RegExpRange(re, 2, &start, &end); - if (start) { - Tcl_Obj *elt = Tcl_NewStringObj(":", 1); - Tcl_RegExpRange(re, 0, &start, &end); - Tcl_AppendToObj(elt, path, end - start); - Tcl_ListObjAppendElement(NULL, result, elt); - return result; - } - - Tcl_RegExpRange(re, 5, &start, &end); - if (start) { - /* - * Unix-style tilde prefixed paths. - */ - - isMac = 0; - i = 5; - } else { - Tcl_RegExpRange(re, 7, &start, &end); - if (start) { - /* - * Mac-style tilde prefixed paths. - */ - - isMac = 1; - i = 7; - } else { - Tcl_RegExpRange(re, 10, &start, &end); - if (start) { - /* - * Normal Unix style paths. - */ - - isMac = 0; - i = 10; - } else { - Tcl_RegExpRange(re, 12, &start, &end); - if (start) { - /* - * Normal Mac style paths. - */ - - isMac = 1; - i = 12; - } - } - } - } - Tcl_RegExpRange(re, i, &start, &end); - length = end - start; - - /* - * Append the element and terminate it with a : - */ - - nextElt = Tcl_NewStringObj(start, length); - Tcl_AppendToObj(nextElt, ":", 1); - Tcl_ListObjAppendElement(NULL, result, nextElt); - p = end; - } else { - isMac = (strchr(path, ':') != NULL); - p = path; - } -#else - if ((path[0] != ':') && (path[0] == '~' || (strchr(path,':') != NULL))) { - CONST char *end; - Tcl_Obj *nextElt; - - isMac = 1; - - end = strchr(path,':'); - if (end == NULL) { - length = strlen(path); - } else { - length = end - path; - } - - /* - * Append the element and terminate it with a : - */ - - nextElt = Tcl_NewStringObj(path, length); - Tcl_AppendToObj(nextElt, ":", 1); - Tcl_ListObjAppendElement(NULL, result, nextElt); - p = path + length; - } else { - isMac = (strchr(path, ':') != NULL); - isMac = 1; - p = path; - } -#endif - - if (isMac) { - - /* - * p is pointing at the first colon in the path. There - * will always be one, since this is a Mac-style path. - * (This is no longer true if MAC_UNDERSTANDS_UNIX_PATHS - * is false, so we must check whether 'p' points to the - * end of the string.) - */ - elementStart = p; - if (*p == ':') { - p++; - } - - while ((p = strchr(p, ':')) != NULL) { - length = p - elementStart; - if (length == 1) { - while (*p == ':') { - Tcl_ListObjAppendElement(NULL, result, - Tcl_NewStringObj("::", 2)); - elementStart = p++; - } - } else { - /* - * If this is a simple component, drop the leading colon. - */ - - if ((elementStart[1] != '~') - && (strchr(elementStart+1, '/') == NULL)) { - elementStart++; - length--; - } - Tcl_ListObjAppendElement(NULL, result, - Tcl_NewStringObj(elementStart, length)); - elementStart = p++; - } - } - if (elementStart[0] != ':') { - if (elementStart[0] != '\0') { - Tcl_ListObjAppendElement(NULL, result, - Tcl_NewStringObj(elementStart, -1)); - } - } else { - if (elementStart[1] != '\0' || elementStart == path) { - if ((elementStart[1] != '~') && (elementStart[1] != '\0') - && (strchr(elementStart+1, '/') == NULL)) { - elementStart++; - } - Tcl_ListObjAppendElement(NULL, result, - Tcl_NewStringObj(elementStart, -1)); - } - } - } else { - - /* - * Split on slashes, suppress extra /'s, and convert .. to ::. - */ - - for (;;) { - elementStart = p; - while ((*p != '\0') && (*p != '/')) { - p++; - } - length = p - elementStart; - if (length > 0) { - if ((length == 1) && (elementStart[0] == '.')) { - Tcl_ListObjAppendElement(NULL, result, - Tcl_NewStringObj(":", 1)); - } else if ((length == 2) && (elementStart[0] == '.') - && (elementStart[1] == '.')) { - Tcl_ListObjAppendElement(NULL, result, - Tcl_NewStringObj("::", 2)); - } else { - Tcl_Obj *nextElt; - if (*elementStart == '~') { - nextElt = Tcl_NewStringObj(":",1); - Tcl_AppendToObj(nextElt, elementStart, length); - } else { - nextElt = Tcl_NewStringObj(elementStart, length); - } - Tcl_ListObjAppendElement(NULL, result, nextElt); - } - } - if (*p++ == '\0') { - break; - } - } - } - return result; -} - -/* *--------------------------------------------------------------------------- * * Tcl_FSJoinToPath -- @@ -1222,85 +800,6 @@ TclpNativeJoinPath(prefix, joining) Tcl_SetObjLength(prefix, length); break; - case TCL_PLATFORM_MAC: { - int newLength; - - /* - * Sort out separators. We basically add the object we've - * been given, but we have to make sure that there is - * exactly one separator inbetween (unless the object we're - * adding contains multiple contiguous colons, all of which - * we must add). Also if an object is just ':' we don't - * bother to add it unless it's the very first element. - */ - -#ifdef MAC_UNDERSTANDS_UNIX_PATHS - int adjustedPath = 0; - if ((strchr(p, ':') == NULL) && (strchr(p, '/') != NULL)) { - char *start = p; - adjustedPath = 1; - while (*start != '\0') { - if (*start == '/') { - *start = ':'; - } - start++; - } - } -#endif - if (length > 0) { - if ((p[0] == ':') && (p[1] == '\0')) { - return; - } - if (start[length-1] != ':') { - if (*p != '\0' && *p != ':') { - Tcl_AppendToObj(prefix, ":", 1); - length++; - } - } else if (*p == ':') { - p++; - } - } else { - if (*p != '\0' && *p != ':') { - Tcl_AppendToObj(prefix, ":", 1); - length++; - } - } - - /* - * Append the element - */ - - newLength = strlen(p); - /* - * It may not be good to just do 'Tcl_AppendToObj(prefix, - * p, newLength)' because the object may contain duplicate - * colons which we want to get rid of. - */ - Tcl_AppendToObj(prefix, p, newLength); - - /* Remove spurious trailing single ':' */ - dest = Tcl_GetString(prefix) + length + newLength; - if (*(dest-1) == ':') { - if (dest-1 > Tcl_GetString(prefix)) { - if (*(dest-2) != ':') { - Tcl_SetObjLength(prefix, length + newLength -1); - } - } - } -#ifdef MAC_UNDERSTANDS_UNIX_PATHS - /* Revert the path to what it was */ - if (adjustedPath) { - char *start = joining; - while (*start != '\0') { - if (*start == ':') { - *start = '/'; - } - start++; - } - } -#endif - break; - } } return; } @@ -1459,18 +958,6 @@ TclGetExtension(name) lastSep = strrchr(name, '/'); break; - case TCL_PLATFORM_MAC: -#ifdef MAC_UNDERSTANDS_UNIX_PATHS - if (strchr(name, ':') == NULL) { - lastSep = strrchr(name, '/'); - } else { - lastSep = strrchr(name, ':'); - } -#else - lastSep = strrchr(name, ':'); -#endif - break; - case TCL_PLATFORM_WINDOWS: lastSep = NULL; for (p = name; *p != '\0'; p++) { @@ -1699,9 +1186,6 @@ Tcl_GlobObjCmd(dummy, interp, objc, objv) case TCL_PLATFORM_WINDOWS: separators = "/\\:"; break; - case TCL_PLATFORM_MAC: - separators = ":"; - break; } if (dir == PATH_GENERAL) { int pathlength; @@ -2040,17 +1524,6 @@ TclGlob(interp, pattern, unquotedPrefix, globFlags, types) case TCL_PLATFORM_WINDOWS: separators = "/\\:"; break; - case TCL_PLATFORM_MAC: -#ifdef MAC_UNDERSTANDS_UNIX_PATHS - if (unquotedPrefix == NULL) { - separators = (strchr(pattern, ':') == NULL) ? "/" : ":"; - } else { - separators = ":"; - } -#else - separators = ":"; -#endif - break; } Tcl_DStringInit(&buffer); @@ -2183,16 +1656,6 @@ TclGlob(interp, pattern, unquotedPrefix, globFlags, types) Tcl_ListObjGetElements(NULL, Tcl_GetObjResult(interp), &objc, &objv); -#ifdef MAC_TCL - /* adjust prefixLen if TclDoGlob prepended a ':' */ - if ((prefixLen > 0) && (objc > 0) - && (Tcl_DStringValue(&buffer)[0] != ':')) { - char *str = Tcl_GetStringFromObj(objv[0],NULL); - if (str[0] == ':') { - prefixLen++; - } - } -#endif for (i = 0; i< objc; i++) { Tcl_Obj* elt; if (globFlags & TCL_GLOBMODE_TAILS) { @@ -2353,13 +1816,11 @@ TclDoGlob(interp, separators, headPtr, tail, types) } else if (strchr(separators, *tail) == NULL) { break; } - if (tclPlatform != TCL_PLATFORM_MAC) { if (*tail == '\\') { Tcl_DStringAppend(headPtr, separators, 1); } else { Tcl_DStringAppend(headPtr, tail, 1); } - } count++; } @@ -2370,31 +1831,6 @@ TclDoGlob(interp, separators, headPtr, tail, types) */ switch (tclPlatform) { - case TCL_PLATFORM_MAC: -#ifdef MAC_UNDERSTANDS_UNIX_PATHS - if (*separators == '/') { - if (((length == 0) && (count == 0)) - || ((length > 0) && (lastChar != ':'))) { - Tcl_DStringAppend(headPtr, ":", 1); - } - } else { -#endif - if (count == 0) { - if ((length > 0) && (lastChar != ':')) { - Tcl_DStringAppend(headPtr, ":", 1); - } - } else { - if (lastChar == ':') { - count--; - } - while (count-- > 0) { - Tcl_DStringAppend(headPtr, ":", 1); - } - } -#ifdef MAC_UNDERSTANDS_UNIX_PATHS - } -#endif - break; case TCL_PLATFORM_WINDOWS: /* * If this is a drive relative path, add the colon and the @@ -2575,11 +2011,7 @@ TclDoGlob(interp, separators, headPtr, tail, types) Tcl_DStringAppend(&ds, "./", 2); } Tcl_DStringAppend(&ds, Tcl_GetString(elt), -1); - if(tclPlatform == TCL_PLATFORM_MAC) { - Tcl_DStringAppend(&ds, ":",1); - } else { Tcl_DStringAppend(&ds, "/",1); - } ret = TclDoGlob(interp, separators, &ds, p+1, types); Tcl_DStringFree(&ds); if (ret != TCL_OK) { @@ -2630,12 +2062,6 @@ TclDoGlob(interp, separators, headPtr, tail, types) Tcl_Obj *nameObj; switch (tclPlatform) { - case TCL_PLATFORM_MAC: { - if (strchr(Tcl_DStringValue(headPtr), ':') == NULL) { - Tcl_DStringAppend(headPtr, ":", 1); - } - break; - } case TCL_PLATFORM_WINDOWS: { if (Tcl_DStringLength(headPtr) == 0) { if (((*name == '\\') && (name[1] == '/' || name[1] == '\\')) @@ -2737,8 +2163,7 @@ TclFileDirname(interp, pathPtr) splitResultPtr = Tcl_FSJoinPath(splitPtr, splitElements - 1); } else if (splitElements == 0 || (Tcl_FSGetPathType(pathPtr) == TCL_PATH_RELATIVE)) { - splitResultPtr = Tcl_NewStringObj( - ((tclPlatform == TCL_PLATFORM_MAC) ? ":" : "."), 1); + splitResultPtr = Tcl_NewStringObj(".", 1); } else { Tcl_ListObjIndex(NULL, splitPtr, 0, &splitResultPtr); } diff --git a/generic/tclGet.c b/generic/tclGet.c index b15f100..c16da0d 100644 --- a/generic/tclGet.c +++ b/generic/tclGet.c @@ -14,7 +14,7 @@ #include "tclInt.h" #include "tclPort.h" -#include "tclMath.h" +#include /* diff --git a/generic/tclGetDate.y b/generic/tclGetDate.y index d210526..52a5052 100644 --- a/generic/tclGetDate.y +++ b/generic/tclGetDate.y @@ -31,15 +31,9 @@ #include "tclInt.h" #include "tclPort.h" -#if defined(MAC_TCL) && !defined(TCL_MAC_USE_MSL_EPOCH) -# define EPOCH 1904 -# define START_OF_TIME 1904 -# define END_OF_TIME 2039 -#else -# define EPOCH 1970 -# define START_OF_TIME 1902 -# define END_OF_TIME 2037 -#endif +#define EPOCH 1970 +#define START_OF_TIME 1902 +#define END_OF_TIME 2037 /* * The offset of tm_year of struct tm returned by localtime, gmtime, etc. diff --git a/generic/tclIOCmd.c b/generic/tclIOCmd.c index 2b3a5a8..635490c 100644 --- a/generic/tclIOCmd.c +++ b/generic/tclIOCmd.c @@ -706,14 +706,6 @@ Tcl_ExecObjCmd(dummy, interp, objc, objv) int objc; /* Number of arguments. */ Tcl_Obj *CONST objv[]; /* Argument objects. */ { -#ifdef MAC_TCL - - Tcl_AppendResult(interp, "exec not implemented under Mac OS", - (char *)NULL); - return TCL_ERROR; - -#else /* !MAC_TCL */ - /* * This procedure generates an argv array for the string arguments. It * starts out with stack-allocated space but uses dynamically-allocated @@ -854,7 +846,6 @@ Tcl_ExecObjCmd(dummy, interp, objc, objv) Tcl_SetObjResult(interp, resultPtr); return result; -#endif /* !MAC_TCL */ } /* @@ -965,12 +956,6 @@ Tcl_OpenObjCmd(notUsed, interp, objc, objv) if (!pipeline) { chan = Tcl_FSOpenFileChannel(interp, objv[1], modeString, prot); } else { -#ifdef MAC_TCL - Tcl_AppendResult(interp, - "command pipelines not supported on Macintosh OS", - (char *)NULL); - return TCL_ERROR; -#else int mode, seekFlag, cmdObjc; CONST char **cmdArgv; @@ -1000,7 +985,6 @@ Tcl_OpenObjCmd(notUsed, interp, objc, objv) chan = Tcl_OpenCommandChannel(interp, cmdObjc, cmdArgv, flags); } ckfree((char *) cmdArgv); -#endif } if (chan == (Tcl_Channel) NULL) { return TCL_ERROR; diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index cfa01f0..105c038 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -26,9 +26,6 @@ #include #include "tclInt.h" #include "tclPort.h" -#ifdef MAC_TCL -#include "tclMacInt.h" -#endif #ifdef __WIN32__ /* for tclWinProcs->useWide */ #include "tclWinInt.h" @@ -2907,7 +2904,7 @@ Tcl_FSLoadFile(interp, pathPtr, sym1, sym2, proc1Ptr, proc2Ptr, FsDivertLoad *tvdlPtr; int retVal; -#if !defined(__WIN32__) && !defined(MAC_TCL) +#if !defined(__WIN32__) /* * Do we need to set appropriate permissions * on the file? This may be required on some @@ -4292,9 +4289,6 @@ NativeFilesystemSeparator(pathObjPtr) case TCL_PLATFORM_WINDOWS: separator = "\\"; break; - case TCL_PLATFORM_MAC: - separator = ":"; - break; } return Tcl_NewStringObj(separator,1); } @@ -4912,11 +4906,6 @@ Tcl_FSJoinPath(listObj, elements) Tcl_DecrRefCount(res); return tail; } - } else if (tclPlatform == TCL_PLATFORM_MAC) { - if (strchr(str, '/') == NULL) { - Tcl_DecrRefCount(res); - return tail; - } } } } @@ -5066,7 +5055,6 @@ FindSplitPos(path, separator) int count = 0; switch (tclPlatform) { case TCL_PLATFORM_UNIX: - case TCL_PLATFORM_MAC: while (path[count] != 0) { if (path[count] == *separator) { return count; @@ -5121,18 +5109,6 @@ TclNewFSPathObj(Tcl_Obj *dirPtr, CONST char *addStrRep, int len) objPtr = Tcl_NewObj(); fsPathPtr = (FsPath*)ckalloc((unsigned)sizeof(FsPath)); - if (tclPlatform == TCL_PLATFORM_MAC) { - /* - * Mac relative paths may begin with a directory separator ':'. - * If present, we need to skip this ':' because we assume that - * we can join dirPtr and addStrRep by concatenating them as - * strings (and we ensure that dirPtr is terminated by a ':'). - */ - if (addStrRep[0] == ':') { - addStrRep++; - len--; - } - } /* Setup the path */ fsPathPtr->translatedPathPtr = NULL; fsPathPtr->normPathPtr = Tcl_NewStringObj(addStrRep, len); @@ -5312,11 +5288,6 @@ TclFSMakePathRelative(interp, objPtr, cwdPtr) cwdLen++; } break; - case TCL_PLATFORM_MAC: - if (tempStr[cwdLen-1] != ':') { - cwdLen++; - } - break; } tempStr = Tcl_GetStringFromObj(objPtr, &len); @@ -5645,12 +5616,6 @@ Tcl_FSGetNormalizedPath(interp, pathObjPtr) cwdLen++; } break; - case TCL_PLATFORM_MAC: - if (cwdStr[cwdLen-1] != ':') { - Tcl_AppendToObj(copy, ":", 1); - cwdLen++; - } - break; } Tcl_AppendObjToObj(copy, fsPathPtr->normPathPtr); @@ -5748,12 +5713,6 @@ Tcl_FSGetNormalizedPath(interp, pathObjPtr) cwdLen++; } break; - case TCL_PLATFORM_MAC: - if (cwdStr[cwdLen-1] != ':') { - Tcl_AppendToObj(copy, ":", 1); - cwdLen++; - } - break; } Tcl_AppendObjToObj(copy, pathObjPtr); /* @@ -6184,10 +6143,6 @@ SetFsPathFromAny(interp, objPtr) int split; char separator='/'; - if (tclPlatform==TCL_PLATFORM_MAC) { - if (strchr(name, ':') != NULL) separator = ':'; - } - split = FindSplitPos(name, &separator); if (split != len) { /* We have multiple pieces '~user/foo/bar...' */ @@ -6453,12 +6408,6 @@ UpdateStringOfFsPath(objPtr) } } break; - case TCL_PLATFORM_MAC: - if (cwdStr[cwdLen-1] != ':') { - Tcl_AppendToObj(copy, ":", 1); - cwdLen++; - } - break; } Tcl_AppendObjToObj(copy, fsPathPtr->normPathPtr); objPtr->bytes = Tcl_GetStringFromObj(copy, &cwdLen); diff --git a/generic/tclInt.h b/generic/tclInt.h index 20c1155..a9a876e 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -1694,8 +1694,7 @@ typedef struct Interp { typedef enum { TCL_PLATFORM_UNIX, /* Any Unix-like OS. */ - TCL_PLATFORM_MAC, /* MacOS. */ - TCL_PLATFORM_WINDOWS /* Any Microsoft Windows OS. */ + TCL_PLATFORM_WINDOWS=2 /* Any Microsoft Windows OS. */ } TclPlatformType; /* @@ -2295,25 +2294,6 @@ EXTERN int Tcl_WhileObjCmd _ANSI_ARGS_((ClientData clientData, /* *---------------------------------------------------------------- - * Command procedures found only in the Mac version of the core: - *---------------------------------------------------------------- - */ - -#ifdef MAC_TCL -EXTERN int Tcl_EchoCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int argc, CONST84 char **argv)); -EXTERN int Tcl_LsObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_BeepObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_MacSourceObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Tcl_ResourceObjCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -#endif - -/* - *---------------------------------------------------------------- * Compilation procedures for commands in the generic core: *---------------------------------------------------------------- */ diff --git a/generic/tclMain.c b/generic/tclMain.c index 8252170..28a3dab 100644 --- a/generic/tclMain.c +++ b/generic/tclMain.c @@ -23,11 +23,7 @@ * the Tcl source directory to make their own modified versions). */ -#if !defined(MAC_TCL) extern int isatty _ANSI_ARGS_((int fd)); -#else -#include -#endif static Tcl_Obj *tclStartupScriptPath = NULL; diff --git a/generic/tclMath.h b/generic/tclMath.h index 7492af0..0f02855 100644 --- a/generic/tclMath.h +++ b/generic/tclMath.h @@ -16,10 +16,6 @@ #ifndef _TCLMATH #define _TCLMATH -#if defined(MAC_TCL) -# include "tclMacMath.h" -#else -# include -#endif +#include #endif /* _TCLMATH */ diff --git a/generic/tclNotify.c b/generic/tclNotify.c index bf82f1c..1f5a607 100644 --- a/generic/tclNotify.c +++ b/generic/tclNotify.c @@ -213,7 +213,7 @@ void Tcl_SetNotifier(notifierProcPtr) Tcl_NotifierProcs *notifierProcPtr; { -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ +#if !defined(__WIN32__) /* UNIX */ tclStubs.tcl_CreateFileHandler = notifierProcPtr->createFileHandlerProc; tclStubs.tcl_DeleteFileHandler = notifierProcPtr->deleteFileHandlerProc; #endif diff --git a/generic/tclPort.h b/generic/tclPort.h index f4fb831..c5d8b71 100644 --- a/generic/tclPort.h +++ b/generic/tclPort.h @@ -19,11 +19,7 @@ #if defined(__WIN32__) # include "tclWinPort.h" #else -# if defined(MAC_TCL) -# include "tclMacPort.h" -# else -# include "tclUnixPort.h" -# endif +# include "tclUnixPort.h" #endif #if !defined(LLONG_MIN) diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index 2eb2351..c601256 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -44,7 +44,7 @@ Tcl_NotifierProcs tclOriginalNotifier = { Tcl_SetTimer, Tcl_WaitForEvent, -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ +#if !defined(__WIN32__) /* UNIX */ Tcl_CreateFileHandler, Tcl_DeleteFileHandler, #else @@ -194,16 +194,6 @@ Tcl_WinTCharToUtf( # define TclpGmtime_unix TclpGmtime #endif -#ifdef MAC_TCL -#define Tcl_DetachPids 0 -#define Tcl_OpenCommandChannel 0 -#define Tcl_ReapDetachedProcs 0 -#define TclCleanupChildren 0 -#define TclCreatePipeline 0 -#define TclSockMinimumBuffersOld 0 -#define TclSockMinimumBuffers 0 -#endif - /* * WARNING: The contents of this file is automatically generated by the * tools/genStubs.tcl script. Any modifications to the function declarations diff --git a/generic/tclTest.c b/generic/tclTest.c index e3fe579..51051bd 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -3757,8 +3757,6 @@ TestsetplatformCmd(clientData, interp, argc, argv) length = strlen(argv[1]); if (strncmp(argv[1], "unix", length) == 0) { *platform = TCL_PLATFORM_UNIX; - } else if (strncmp(argv[1], "mac", length) == 0) { - *platform = TCL_PLATFORM_MAC; } else if (strncmp(argv[1], "windows", length) == 0) { *platform = TCL_PLATFORM_WINDOWS; } else { @@ -4825,11 +4823,6 @@ static int PretendTclpStat(path, buf) #endif /* TCL_WIDE_INT_IS_LONG */ } -/* Be careful in the compares in these tests, since the Macintosh puts a - * leading : in the beginning of non-absolute paths before passing them - * into the file command procedures. - */ - static int TestStatProc1(path, buf) CONST char *path; diff --git a/generic/tclThreadJoin.c b/generic/tclThreadJoin.c index f3c6abd..f097924 100644 --- a/generic/tclThreadJoin.c +++ b/generic/tclThreadJoin.c @@ -14,7 +14,7 @@ #include "tclInt.h" -#if defined(WIN32) || defined(MAC_TCL) +#if defined(WIN32) /* The information about each joinable thread is remembered in a * structure as defined below. @@ -306,4 +306,4 @@ TclSignalExitThread(id,result) Tcl_MutexUnlock (&threadPtr->threadMutex); } -#endif /* WIN32 || MAC_TCL */ +#endif /* WIN32 */ diff --git a/library/init.tcl b/library/init.tcl index 02bce3b..cd02549 100644 --- a/library/init.tcl +++ b/library/init.tcl @@ -35,7 +35,6 @@ package require -exact Tcl 8.4 # tcl_pkgPath, which is set by the platform-specific initialization routines # On UNIX it is compiled in # On Windows, it is not used -# On Macintosh it is "Tool Command Language" in the Extensions folder if {![info exists auto_path]} { if {[info exists env(TCLLIBPATH)]} { @@ -117,18 +116,11 @@ if {![interp issafe]} { && $::tcl_platform(os) eq "Darwin"} { package unknown [list tcl::MacOSXPkgUnknown [package unknown]] } - if {$::tcl_platform(platform) eq "macintosh"} { - package unknown [list tcl::MacPkgUnknown [package unknown]] - } } # Conditionalize for presence of exec. if {[namespace which -command exec] eq ""} { - - # Some machines, such as the Macintosh, do not have exec. Also, on all - # platforms, safe interpreters do not have exec. - set auto_noexec 1 } set errorCode "" diff --git a/library/package.tcl b/library/package.tcl index 3ed8d3c..c19640e 100644 --- a/library/package.tcl +++ b/library/package.tcl @@ -460,8 +460,7 @@ proc tclPkgSetup {dir pkg version files} { # It is invoked when a package that's needed can't be found. It scans # the auto_path directories and their immediate children looking for # pkgIndex.tcl files and sources any such files that are found to setup -# the package database. (On the Macintosh we also search for pkgIndex -# TEXT resources in all files.) As it searches, it will recognize changes +# the package database. As it searches, it will recognize changes # to the auto_path and scan any new directories. # # Arguments: diff --git a/tests/all.tcl b/tests/all.tcl index db811a7..d8129f7 100644 --- a/tests/all.tcl +++ b/tests/all.tcl @@ -13,10 +13,6 @@ set tcltestVersion [package require tcltest] namespace import -force tcltest::* -if {$tcl_platform(platform) == "macintosh"} { - tcltest::singleProcess 1 -} - tcltest::testsDirectory [file dir [info script]] tcltest::runAllTests diff --git a/tests/binary.test b/tests/binary.test index 122fcdf..d2cbb1f 100644 --- a/tests/binary.test +++ b/tests/binary.test @@ -512,9 +512,6 @@ test binary-14.11 {Tcl_BinaryObjCmd: format} {nonPortable pcOnly} { test binary-14.12 {Tcl_BinaryObjCmd: float overflow} {nonPortable unixOnly} { binary format d NaN } \x7f\xff\xff\xff\xff\xff\xff\xff -test binary-14.13 {Tcl_BinaryObjCmd: float overflow} {nonPortable macOnly} { - binary format d NaN -} \x7f\xf8\x02\xa0\x00\x00\x00\x00 test binary-14.14 {Tcl_BinaryObjCmd: format} { list [catch {binary format d2 {1.6}} msg] $msg } {1 {number of elements in list does not match count}} @@ -1403,10 +1400,6 @@ test binary-40.1 {ScanNumber: floating point overflow} {nonPortable unixOnly} { catch {unset arg1} list [binary scan \xff\xff\xff\xff f1 arg1] $arg1 } {1 -NaN} -test binary-40.2 {ScanNumber: floating point overflow} {nonPortable macOnly} { - catch {unset arg1} - list [binary scan \xff\xff\xff\xff f1 arg1] $arg1 -} {1 -NAN(255)} test binary-40.3 {ScanNumber: floating point overflow} {nonPortable pcOnly} { catch {unset arg1} set result [binary scan \xff\xff\xff\xff f1 arg1] @@ -1421,10 +1414,6 @@ test binary-40.4 {ScanNumber: floating point overflow} {nonPortable unixOnly} { catch {unset arg1} list [binary scan \xff\xff\xff\xff\xff\xff\xff\xff d1 arg1] $arg1 } {1 -NaN} -test binary-40.5 {ScanNumber: floating point overflow} {nonPortable macOnly} { - catch {unset arg1} - list [binary scan \xff\xff\xff\xff\xff\xff\xff\xff d1 arg1] $arg1 -} {1 -NAN(255)} test binary-40.6 {ScanNumber: floating point overflow} {nonPortable pcOnly} { catch {unset arg1} set result [binary scan \xff\xff\xff\xff\xff\xff\xff\xff d1 arg1] diff --git a/tests/cmdAH.test b/tests/cmdAH.test index eb7d96a..28e396f 100644 --- a/tests/cmdAH.test +++ b/tests/cmdAH.test @@ -238,10 +238,6 @@ test cmdAH-8.3 {Tcl_FileObjCmd: dirname} { testsetplatform unix file dirname {} } . -test cmdAH-8.4 {Tcl_FileObjCmd: dirname} { - testsetplatform mac - file dirname {} -} : test cmdAH-8.5 {Tcl_FileObjCmd: dirname} { testsetplatform win file dirname {} @@ -250,10 +246,6 @@ test cmdAH-8.6 {Tcl_FileObjCmd: dirname} { testsetplatform unix file dirname .def } . -test cmdAH-8.7 {Tcl_FileObjCmd: dirname} { - testsetplatform mac - file dirname a -} : test cmdAH-8.8 {Tcl_FileObjCmd: dirname} { testsetplatform win file dirname a @@ -330,50 +322,6 @@ test cmdAH-8.26 {Tcl_FileObjCmd: dirname} { testsetplatform windows list [catch {file dirname {//foo/bar}} msg] $msg } {0 //foo/bar} -test cmdAH-8.27 {Tcl_FileObjCmd: dirname} { - testsetplatform mac - list [catch {file dirname :} msg] $msg -} {0 :} -test cmdAH-8.28 {Tcl_FileObjCmd: dirname} { - testsetplatform mac - list [catch {file dirname :Foo} msg] $msg -} {0 :} -test cmdAH-8.29 {Tcl_FileObjCmd: dirname} { - testsetplatform mac - list [catch {file dirname Foo:} msg] $msg -} {0 Foo:} -test cmdAH-8.30 {Tcl_FileObjCmd: dirname} { - testsetplatform mac - list [catch {file dirname Foo:bar} msg] $msg -} {0 Foo:} -test cmdAH-8.31 {Tcl_FileObjCmd: dirname} { - testsetplatform mac - list [catch {file dirname :Foo:bar} msg] $msg -} {0 :Foo} -test cmdAH-8.32 {Tcl_FileObjCmd: dirname} { - testsetplatform mac - list [catch {file dirname ::} msg] $msg -} {0 :} -test cmdAH-8.33 {Tcl_FileObjCmd: dirname} { - testsetplatform mac - list [catch {file dirname :::} msg] $msg -} {0 ::} -test cmdAH-8.34 {Tcl_FileObjCmd: dirname} { - testsetplatform mac - list [catch {file dirname /foo/bar/} msg] $msg -} {0 foo:} -test cmdAH-8.35 {Tcl_FileObjCmd: dirname} { - testsetplatform mac - list [catch {file dirname /foo/bar} msg] $msg -} {0 foo:} -test cmdAH-8.36 {Tcl_FileObjCmd: dirname} { - testsetplatform mac - list [catch {file dirname /foo} msg] $msg -} {0 foo:} -test cmdAH-8.37 {Tcl_FileObjCmd: dirname} { - testsetplatform mac - list [catch {file dirname foo} msg] $msg -} {0 :} test cmdAH-8.38 {Tcl_FileObjCmd: dirname} { testsetplatform unix list [catch {file dirname ~/foo} msg] $msg @@ -382,18 +330,6 @@ test cmdAH-8.39 {Tcl_FileObjCmd: dirname} { testsetplatform unix list [catch {file dirname ~bar/foo} msg] $msg } {0 ~bar} -test cmdAH-8.40 {Tcl_FileObjCmd: dirname} { - testsetplatform mac - list [catch {file dirname ~bar/foo} msg] $msg -} {0 ~bar:} -test cmdAH-8.41 {Tcl_FileObjCmd: dirname} { - testsetplatform mac - list [catch {file dirname ~/foo} msg] $msg -} {0 ~:} -test cmdAH-8.42 {Tcl_FileObjCmd: dirname} { - testsetplatform mac - list [catch {file dirname ~:baz} msg] $msg -} {0 ~:} test cmdAH-8.43 {Tcl_FileObjCmd: dirname} { global env set temp $env(HOME) @@ -421,15 +357,6 @@ test cmdAH-8.45 {Tcl_FileObjCmd: dirname} { set env(HOME) $temp set result } {0 /homewontexist} -test cmdAH-8.46 {Tcl_FileObjCmd: dirname} { - global env - set temp $env(HOME) - set env(HOME) "/home/test" - testsetplatform mac - set result [list [catch {file dirname ~} msg] $msg] - set env(HOME) $temp - set result -} {0 home:} # tail @@ -445,10 +372,6 @@ test cmdAH-9.3 {Tcl_FileObjCmd: tail} { testsetplatform unix file tail {} } {} -test cmdAH-9.4 {Tcl_FileObjCmd: tail} { - testsetplatform mac - file tail {} -} {} test cmdAH-9.5 {Tcl_FileObjCmd: tail} { testsetplatform win file tail {} @@ -457,10 +380,6 @@ test cmdAH-9.6 {Tcl_FileObjCmd: tail} { testsetplatform unix file tail .def } .def -test cmdAH-9.7 {Tcl_FileObjCmd: tail} { - testsetplatform mac - file tail a -} a test cmdAH-9.8 {Tcl_FileObjCmd: tail} { testsetplatform win file tail a @@ -537,66 +456,6 @@ test cmdAH-9.26 {Tcl_FileObjCmd: tail} { testsetplatform windows file tail {//foo/bar} } {} -test cmdAH-9.27 {Tcl_FileObjCmd: tail} { - testsetplatform mac - file tail : -} : -test cmdAH-9.28 {Tcl_FileObjCmd: tail} { - testsetplatform mac - file tail :Foo -} Foo -test cmdAH-9.29 {Tcl_FileObjCmd: tail} { - testsetplatform mac - file tail Foo: -} {} -test cmdAH-9.30 {Tcl_FileObjCmd: tail} { - testsetplatform mac - file tail Foo:bar -} bar -test cmdAH-9.31 {Tcl_FileObjCmd: tail} { - testsetplatform mac - file tail :Foo:bar -} bar -test cmdAH-9.32 {Tcl_FileObjCmd: tail} { - testsetplatform mac - file tail :: -} :: -test cmdAH-9.33 {Tcl_FileObjCmd: tail} { - testsetplatform mac - file tail ::: -} :: -test cmdAH-9.34 {Tcl_FileObjCmd: tail} { - testsetplatform mac - file tail /foo/bar/ -} bar -test cmdAH-9.35 {Tcl_FileObjCmd: tail} { - testsetplatform mac - file tail /foo/bar -} bar -test cmdAH-9.36 {Tcl_FileObjCmd: tail} { - testsetplatform mac - file tail /foo -} {} -test cmdAH-9.37 {Tcl_FileObjCmd: tail} { - testsetplatform mac - file tail foo -} foo -test cmdAH-9.38 {Tcl_FileObjCmd: tail} { - testsetplatform mac - file tail ~:foo -} foo -test cmdAH-9.39 {Tcl_FileObjCmd: tail} { - testsetplatform mac - file tail ~bar:foo -} foo -test cmdAH-9.40 {Tcl_FileObjCmd: tail} { - testsetplatform mac - file tail ~bar/foo -} foo -test cmdAH-9.41 {Tcl_FileObjCmd: tail} { - testsetplatform mac - file tail ~/foo -} foo test cmdAH-9.42 {Tcl_FileObjCmd: tail} { global env set temp $env(HOME) @@ -624,15 +483,6 @@ test cmdAH-9.44 {Tcl_FileObjCmd: tail} { set env(HOME) $temp set result } test -test cmdAH-9.45 {Tcl_FileObjCmd: tail} { - global env - set temp $env(HOME) - set env(HOME) "/home/test" - testsetplatform mac - set result [file tail ~] - set env(HOME) $temp - set result -} test test cmdAH-9.46 {Tcl_FileObjCmd: tail} { testsetplatform unix file tail {f.oo\bar/baz.bat} @@ -700,54 +550,6 @@ test cmdAH-10.10 {Tcl_FileObjCmd: rootname} { testsetplatform unix file rootname a/b.c/ } a/b.c/ -test cmdAH-10.11 {Tcl_FileObjCmd: rootname} { - testsetplatform mac - file ro foo -} foo -test cmdAH-10.12 {Tcl_FileObjCmd: rootname} { - testsetplatform mac - file rootname {} -} {} -test cmdAH-10.13 {Tcl_FileObjCmd: rootname} { - testsetplatform mac - file rootname foo. -} foo -test cmdAH-10.14 {Tcl_FileObjCmd: rootname} { - testsetplatform mac - file rootname .foo -} {} -test cmdAH-10.15 {Tcl_FileObjCmd: rootname} { - testsetplatform mac - file rootname abc.def -} abc -test cmdAH-10.16 {Tcl_FileObjCmd: rootname} { - testsetplatform mac - file rootname abc.def.ghi -} abc.def -test cmdAH-10.17 {Tcl_FileObjCmd: rootname} { - testsetplatform mac - file rootname a:b:c.d -} a:b:c -test cmdAH-10.18 {Tcl_FileObjCmd: rootname} { - testsetplatform mac - file rootname a:b.c:d -} a:b.c:d -test cmdAH-10.19 {Tcl_FileObjCmd: rootname} { - testsetplatform mac - file rootname a/b/c.d -} a/b/c -test cmdAH-10.20 {Tcl_FileObjCmd: rootname} { - testsetplatform mac - file rootname a/b.c/d -} a/b.c/d -test cmdAH-10.21 {Tcl_FileObjCmd: rootname} { - testsetplatform mac - file rootname /a.b -} /a -test cmdAH-10.22 {Tcl_FileObjCmd: rootname} { - testsetplatform mac - file rootname foo.c: -} foo.c: test cmdAH-10.23 {Tcl_FileObjCmd: rootname} { testsetplatform windows file rootname {} @@ -850,54 +652,6 @@ test cmdAH-11.10 {Tcl_FileObjCmd: extension} { testsetplatform unix file extension a/b.c/ } {} -test cmdAH-11.11 {Tcl_FileObjCmd: extension} { - testsetplatform mac - file ext foo -} {} -test cmdAH-11.12 {Tcl_FileObjCmd: extension} { - testsetplatform mac - file extension {} -} {} -test cmdAH-11.13 {Tcl_FileObjCmd: extension} { - testsetplatform mac - file extension foo. -} . -test cmdAH-11.14 {Tcl_FileObjCmd: extension} { - testsetplatform mac - file extension .foo -} .foo -test cmdAH-11.15 {Tcl_FileObjCmd: extension} { - testsetplatform mac - file extension abc.def -} .def -test cmdAH-11.16 {Tcl_FileObjCmd: extension} { - testsetplatform mac - file extension abc.def.ghi -} .ghi -test cmdAH-11.17 {Tcl_FileObjCmd: extension} { - testsetplatform mac - file extension a:b:c.d -} .d -test cmdAH-11.18 {Tcl_FileObjCmd: extension} { - testsetplatform mac - file extension a:b.c:d -} {} -test cmdAH-11.19 {Tcl_FileObjCmd: extension} { - testsetplatform mac - file extension a/b/c.d -} .d -test cmdAH-11.20 {Tcl_FileObjCmd: extension} { - testsetplatform mac - file extension a/b.c/d -} {} -test cmdAH-11.21 {Tcl_FileObjCmd: extension} { - testsetplatform mac - file extension /a.b -} .b -test cmdAH-11.22 {Tcl_FileObjCmd: extension} { - testsetplatform mac - file extension foo.c: -} {} test cmdAH-11.23 {Tcl_FileObjCmd: extension} { testsetplatform windows file extension {} @@ -948,7 +702,7 @@ test cmdAH-11.34 {Tcl_FileObjCmd: extension} { } {} set num 35 foreach value {a..b a...b a.c..b ..b} result {.b .b .b .b} { - foreach p {unix mac windows} { + foreach p {unix windows} { ; test cmdAH-7.$num {Tcl_FileObjCmd: extension} " testsetplatform $p file extension $value @@ -1073,13 +827,6 @@ test cmdAH-18.3 {Tcl_FileObjCmd: executable} {unixOnly testchmod} { file exe $gorpfile } 1 -test cmdAH-18.4 {Tcl_FileObjCmd: executable} {macOnly testchmod} { - # On mac, the only executable files are of type APPL. - - set x [file exe $gorpfile] - file attrib $gorpfile -type APPL - lappend x [file exe $gorpfile] -} {0 1} test cmdAH-18.5 {Tcl_FileObjCmd: executable} {winOnly testchmod} { # On pc, must be a .exe, .com, etc. @@ -1134,10 +881,6 @@ test cmdAH-19.7 {Tcl_FileObjCmd: nativename} { testsetplatform windows list [catch {file nativename a/b} msg] $msg [testsetplatform $platform] } {0 {a\b} {}} -test cmdAH-19.8 {Tcl_FileObjCmd: nativename} { - testsetplatform mac - list [catch {file nativename a/b} msg] $msg [testsetplatform $platform] -} {0 :a:b {}} } test cmdAH-19.9 {Tcl_FileObjCmd: ~ : exists} { @@ -1486,10 +1229,6 @@ test cmdAH-26.3 {Tcl_FileObjCmd: readlink errors} {unixOnly nonPortable} { list [catch {file readlink _bogus_} msg] [string tolower $msg] \ [string tolower $errorCode] } {1 {could not readlink "_bogus_": no such file or directory} {posix enoent {no such file or directory}}} -test cmdAH-26.4 {Tcl_FileObjCmd: readlink errors} {macOnly nonPortable} { - list [catch {file readlink _bogus_} msg] [string tolower $msg] \ - [string tolower $errorCode] -} {1 {could not readlink "_bogus_": no such file or directory} {posix enoent {no such file or directory}}} test cmdAH-26.5 {Tcl_FileObjCmd: readlink errors} {winOnly nonPortable} { list [catch {file readlink _bogus_} msg] [string tolower $msg] \ [string tolower $errorCode] diff --git a/tests/cmdMZ.test b/tests/cmdMZ.test index b4e91c6..e782715 100644 --- a/tests/cmdMZ.test +++ b/tests/cmdMZ.test @@ -70,12 +70,6 @@ test cmdMZ-2.4 {Tcl_RenameObjCmd: success} { # Tcl_SourceObjCmd -test cmdMZ-3.1 {Tcl_SourceObjCmd: error conditions} {macOnly} { - list [catch {source} msg] $msg -} {1 {wrong # args: should be "source fileName" or "source -rsrc name ?fileName?" or "source -rsrcid id ?fileName?"}} -test cmdMZ-3.2 {Tcl_SourceObjCmd: error conditions} {macOnly} { - list [catch {source a b} msg] $msg -} {1 {bad argument: should be "source fileName" or "source -rsrc name ?fileName?" or "source -rsrcid id ?fileName?"}} test cmdMZ-3.3 {Tcl_SourceObjCmd: error conditions} {unixOrPc} { list [catch {source} msg] $msg } {1 {wrong # args: should be "source fileName"}} diff --git a/tests/fCmd.test b/tests/fCmd.test index eff2f80..c5ee676 100644 --- a/tests/fCmd.test +++ b/tests/fCmd.test @@ -86,11 +86,7 @@ proc openup {path} { } proc cleanup {args} { - if {$::tcl_platform(platform) == "macintosh"} { - set wd [list :] - } else { - set wd [list .] - } + set wd [list .] foreach p [concat $wd $args] { set x "" catch { @@ -116,17 +112,6 @@ cd [temporaryDirectory] set ::tcltest::testConstraints(fileSharing) 0 set ::tcltest::testConstraints(notFileSharing) 1 - -if {$tcl_platform(platform) == "macintosh"} { - catch {file delete -force foo.dir} - file mkdir foo.dir - if {[catch {file attributes foo.dir -readonly 1}] == 0} { - set ::tcltest::testConstraints(fileSharing) 1 - set ::tcltest::testConstraints(notFileSharing) 0 - } - file delete -force foo.dir -} - set ::tcltest::testConstraints(xdev) 0 if {$tcl_platform(platform) == "unix"} { @@ -318,10 +303,6 @@ test fCmd-4.11 {TclFileMakeDirsCmd: doesn't exist: errno != ENOENT} \ testchmod 755 td1/td2 set msg } {1 {can't create directory "td1/td2/td3": permission denied}} -test fCmd-4.12 {TclFileMakeDirsCmd: doesn't exist: errno != ENOENT} {macOnly} { - cleanup - list [catch {file mkdir nonexistentvolume:} msg] $msg -} {1 {can't create directory "nonexistentvolume:": invalid argument}} test fCmd-4.13 {TclFileMakeDirsCmd: doesn't exist: errno == ENOENT} {notRoot} { cleanup set x [file exists td1] @@ -338,9 +319,6 @@ test fCmd-4.14 {TclFileMakeDirsCmd: TclpCreateDirectory fails} \ file delete -force foo set result } {1 {can't create directory "foo/tf1": permission denied}} -test fCmd-4.15 {TclFileMakeDirsCmd: TclpCreateDirectory fails} {macOnly} { - list [catch {file mkdir ${root}:} msg] $msg -} [subst {1 {can't create directory "${root}:": no such file or directory}}] test fCmd-4.16 {TclFileMakeDirsCmd: TclpCreateDirectory succeeds} {notRoot} { cleanup file mkdir tf1 @@ -457,11 +435,6 @@ test fCmd-6.7 {CopyRenameOneFile: errno != ENOENT} {pcOnly 95} { createfile tf1 list [catch {file rename tf1 $long} msg] $msg } [subst {1 {error renaming "tf1" to "$long": file name too long}}] -test fCmd-6.8 {CopyRenameOneFile: errno != ENOENT} {macOnly} { - cleanup - createfile tf1 - list [catch {file rename tf1 $long} msg] $msg -} [subst {1 {error renaming "tf1" to "$long": file name too long}}] test fCmd-6.9 {CopyRenameOneFile: errno == ENOENT} {unixOnly notRoot} { cleanup createfile tf1 @@ -784,20 +757,18 @@ test fCmd-9.8 {file rename: comprehensive: dir to empty dir} {notRoot testchmod file mkdir [file join tdd2 tds2] file mkdir [file join tdd3 tds3] file mkdir [file join tdd4 tds4] - if {$tcl_platform(platform) != "unix" && $tcl_platform(platform) != "macintosh"} { + if {$tcl_platform(platform) != "unix"} { testchmod 555 tds3 testchmod 555 tds4 } - if {$tcl_platform(platform) != "macintosh"} { - testchmod 555 [file join tdd2 tds2] - testchmod 555 [file join tdd4 tds4] - } + testchmod 555 [file join tdd2 tds2] + testchmod 555 [file join tdd4 tds4] set msg [list [catch {file rename td1 td2} msg] $msg] file rename -force tds1 tdd1 file rename -force tds2 tdd2 file rename -force tds3 tdd3 file rename -force tds4 tdd4 - if {$tcl_platform(platform) != "unix" && $tcl_platform(platform) != "macintosh"} { + if {$tcl_platform(platform) != "unix"} { set w3 [file writable [file join tdd3 tds3]] set w4 [file writable [file join tdd4 tds4]] } else { @@ -813,12 +784,12 @@ test fCmd-9.9 {file rename: comprehensive: dir to non-empty dir} {notRoot testch file mkdir tds2 file mkdir [file join tdd1 tds1 xxx] file mkdir [file join tdd2 tds2 xxx] - if {!([testConstraint unix] || [testConstraint winVista]) && $tcl_platform(platform) != "macintosh"} { + if {!([testConstraint unix] || [testConstraint winVista])} { testchmod 555 tds2 } set a1 [list [catch {file rename -force tds1 tdd1} msg] $msg] set a2 [list [catch {file rename -force tds2 tdd2} msg] $msg] - if {!([testConstraint unix] || [testConstraint winVista]) && $tcl_platform(platform) != "macintosh"} { + if {!([testConstraint unix] || [testConstraint winVista])} { set w2 [file writable tds2] } else { set w2 0 @@ -841,12 +812,12 @@ test fCmd-9.11 {file rename: comprehensive: dir to new name and dir} {notRoot te file mkdir td1 file mkdir td2 file mkdir td3 - if {!([testConstraint unix] || [testConstraint winVista]) && $tcl_platform(platform) != "macintosh"} { + if {!([testConstraint unix] || [testConstraint winVista])} { testchmod 555 td2 } file rename td1 [file join td3 td3] file rename td2 [file join td3 td4] - if {!([testConstraint unix] || [testConstraint winVista]) && $tcl_platform(platform) != "macintosh"} { + if {!([testConstraint unix] || [testConstraint winVista])} { set w4 [file writable [file join td3 td4]] } else { set w4 0 @@ -857,16 +828,12 @@ test fCmd-9.11 {file rename: comprehensive: dir to new name and dir} {notRoot te test fCmd-9.12 {file rename: comprehensive: target exists} {notRoot testchmod notNetworkFilesystem} { cleanup file mkdir [file join td1 td2] [file join td2 td1] - if {$tcl_platform(platform) != "macintosh"} { testchmod 555 [file join td2 td1] - } file mkdir [file join td3 td4] [file join td4 td3] file rename -force td3 td4 set msg [list [file exists td3] [file exists [file join td4 td3 td4]] \ [catch {file rename td1 td2} msg] $msg] - if {$tcl_platform(platform) != "macintosh"} { testchmod 755 [file join td2 td1] - } set msg } [subst {0 1 1 {error renaming "td1" to "[file join td2 td1]": file already exists}}] test fCmd-9.13 {file rename: comprehensive: can't overwrite target} {notRoot} { @@ -916,10 +883,8 @@ test fCmd-10.3 {file copy: comprehensive: dir to new name} {notRoot unixOrPc 95o file copy td2 td4 set msg [list [lsort [glob td*]] [glob -directory td3 t*] \ [glob -directory td4 t*] [file writable td3] [file writable td4]] - if {$tcl_platform(platform) != "macintosh"} { testchmod 755 td2 testchmod 755 td4 - } set msg } [subst {{td1 td2 td3 td4} [file join td3 tdx] [file join td4 tdy] 1 0}] test fCmd-10.3.1 {file copy: comprehensive: dir to new name} {notRoot pc 2000orNewer testchmod} { @@ -971,12 +936,10 @@ test fCmd-10.5 {file copy: comprehensive: dir to empty dir} {notRoot testchmod} file mkdir [file join tdd2 tds2] file mkdir [file join tdd3 tds3] file mkdir [file join tdd4 tds4] - if {$tcl_platform(platform) != "macintosh"} { testchmod 555 tds3 testchmod 555 tds4 testchmod 555 [file join tdd2 tds2] testchmod 555 [file join tdd4 tds4] - } set a1 [list [catch {file copy td1 td2} msg] $msg] set a2 [list [catch {file copy -force tds1 tdd1} msg] $msg] set a3 [catch {file copy -force tds2 tdd2}] diff --git a/tests/fileName.test b/tests/fileName.test index 6c80826..6eabc76 100644 --- a/tests/fileName.test +++ b/tests/fileName.test @@ -56,115 +56,6 @@ test filename-1.8 {Tcl_GetPathType: unix} {testsetplatform} { file pathtype ./~foo } relative -test filename-2.1 {Tcl_GetPathType: mac, denerate names} {testsetplatform} { - testsetplatform mac - file pathtype / -} relative -test filename-2.2 {Tcl_GetPathType: mac, denerate names} {testsetplatform} { - testsetplatform mac - file pathtype /. -} relative -test filename-2.3 {Tcl_GetPathType: mac, denerate names} {testsetplatform} { - testsetplatform mac - file pathtype /.. -} relative -test filename-2.4 {Tcl_GetPathType: mac, denerate names} {testsetplatform} { - testsetplatform mac - file pathtype //.// -} relative -test filename-2.5 {Tcl_GetPathType: mac, denerate names} {testsetplatform} { - testsetplatform mac - file pathtype //.//../. -} relative -test filename-2.6 {Tcl_GetPathType: mac, tilde names} {testsetplatform} { - testsetplatform mac - file pathtype ~ -} absolute -test filename-2.7 {Tcl_GetPathType: mac, tilde names} {testsetplatform} { - testsetplatform mac - file pathtype ~: -} absolute -test filename-2.8 {Tcl_GetPathType: mac, tilde names} {testsetplatform} { - testsetplatform mac - file pathtype ~:foo -} absolute -test filename-2.9 {Tcl_GetPathType: mac, tilde names} {testsetplatform} { - testsetplatform mac - file pathtype ~/ -} absolute -test filename-2.10 {Tcl_GetPathType: mac, tilde names} {testsetplatform} { - testsetplatform mac - file pathtype ~/foo -} absolute -test filename-2.11 {Tcl_GetPathType: mac, unix-style names} {testsetplatform} { - testsetplatform mac - file pathtype /foo -} absolute -test filename-2.12 {Tcl_GetPathType: mac, unix-style names} {testsetplatform} { - testsetplatform mac - file pathtype /./foo -} absolute -test filename-2.13 {Tcl_GetPathType: mac, unix-style names} {testsetplatform} { - testsetplatform mac - file pathtype /..//./foo -} absolute -test filename-2.14 {Tcl_GetPathType: mac, unix-style names} {testsetplatform} { - testsetplatform mac - file pathtype /foo/bar -} absolute -test filename-2.15 {Tcl_GetPathType: mac, unix-style names} {testsetplatform} { - testsetplatform mac - file pathtype foo/bar -} relative -test filename-2.16 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { - testsetplatform mac - file pathtype : -} relative -test filename-2.17 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { - testsetplatform mac - file pathtype :foo -} relative -test filename-2.18 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { - testsetplatform mac - file pathtype foo: -} absolute -test filename-2.19 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { - testsetplatform mac - file pathtype foo:bar -} absolute -test filename-2.20 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { - testsetplatform mac - file pathtype :foo:bar -} relative -test filename-2.21 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { - testsetplatform mac - file pathtype ::foo:bar -} relative -test filename-2.22 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { - testsetplatform mac - file pathtype ~foo -} absolute -test filename-2.23 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { - testsetplatform mac - file pathtype :~foo -} relative -test filename-2.24 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { - testsetplatform mac - file pathtype ~foo: -} absolute -test filename-2.25 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { - testsetplatform mac - file pathtype foo/bar: -} absolute -test filename-2.26 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { - testsetplatform mac - file pathtype /foo: -} absolute -test filename-2.27 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { - testsetplatform mac - file pathtype foo -} relative - test filename-3.1 {Tcl_GetPathType: windows} {testsetplatform} { testsetplatform windows file pathtype / @@ -333,211 +224,6 @@ test filename-4.19 {Tcl_SplitPath} { list $res $err } {0 tildetmp/~tilde} -test filename-5.1 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split a:b -} {a: b} -test filename-5.2 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split a:b:c -} {a: b c} -test filename-5.3 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split a:b:c: -} {a: b c} -test filename-5.4 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split a: -} {a:} -test filename-5.5 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split a:: -} {a: ::} -test filename-5.6 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split a::: -} {a: :: ::} -test filename-5.7 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split :a -} {a} -test filename-5.8 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split :a:: -} {a ::} -test filename-5.9 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split : -} {:} -test filename-5.10 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split :: -} {::} -test filename-5.11 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split ::: -} {:: ::} -test filename-5.12 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split a:::b -} {a: :: :: b} -test filename-5.13 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split /a:b -} {/a: b} -test filename-5.14 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split ~: -} {~:} -test filename-5.15 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split ~/: -} {~/:} -test filename-5.16 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split ~:foo -} {~: foo} -test filename-5.17 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split ~/foo -} {~: foo} -test filename-5.18 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split ~foo: -} {~foo:} -test filename-5.19 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split a:~foo -} {a: :~foo} -test filename-5.20 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split / -} {:/} -test filename-5.21 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split a:b/c -} {a: :b/c} -test filename-5.22 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split /foo -} {foo:} -test filename-5.23 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split /a/b -} {a: b} -test filename-5.24 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split /a/b/foo -} {a: b foo} -test filename-5.25 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split a/b -} {a b} -test filename-5.26 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split ./foo/bar -} {: foo bar} -test filename-5.27 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split ../foo/bar -} {:: foo bar} -test filename-5.28 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split {} -} {} -test filename-5.29 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split . -} {:} -test filename-5.30 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split ././ -} {: :} -test filename-5.31 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split ././. -} {: : :} -test filename-5.32 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split ../ -} {::} -test filename-5.33 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split .. -} {::} -test filename-5.34 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split ../.. -} {:: ::} -test filename-5.35 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split //foo -} {foo:} -test filename-5.36 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split foo//bar -} {foo bar} -test filename-5.37 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split ~foo -} {~foo:} -test filename-5.38 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split ~ -} {~:} -test filename-5.39 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split foo -} {foo} -test filename-5.40 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split ~/ -} {~:} -test filename-5.41 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split ~foo/~bar -} {~foo: :~bar} -test filename-5.42 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split ~foo/~bar/~baz -} {~foo: :~bar :~baz} -test filename-5.43 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split foo/bar~/baz -} {foo bar~ baz} -test filename-5.44 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split a/../b -} {a :: b} -test filename-5.45 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split a/../../b -} {a :: :: b} -test filename-5.46 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split a/.././../b -} {a :: : :: b} -test filename-5.47 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split /../bar -} {bar:} -test filename-5.48 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split /./bar -} {bar:} -test filename-5.49 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split //.//.././bar -} {bar:} -test filename-5.50 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split /.. -} {:/..} -test filename-5.51 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split //.//.././ -} {://.//.././} - test filename-6.1 {Tcl_SplitPath: win} {testsetplatform} { testsetplatform win file split / @@ -732,95 +418,6 @@ test filename-7.18 {Tcl_JoinPath: unix} {testsetplatform} { file join /// a b } {/a/b} -test filename-8.1 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join a b -} {:a:b} -test filename-8.2 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join :a b -} {:a:b} -test filename-8.3 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join a b: -} {b:} -test filename-8.4 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join a: :b -} {a:b} -test filename-8.5 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join a: :b: -} {a:b} -test filename-8.6 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join a :: b -} {:a::b} -test filename-8.7 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join a :: :: b -} {:a:::b} -test filename-8.8 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join a ::: b -} {:a:::b} -test filename-8.9 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join a: b: -} {b:} -test filename-8.10 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join /a/b -} {a:b} -test filename-8.11 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join /a/b c/d -} {a:b:c:d} -test filename-8.12 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join /a/b :c:d -} {a:b:c:d} -test filename-8.13 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join ~ foo -} {~:foo} -test filename-8.14 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join :: :: -} {:::} -test filename-8.15 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join a: :: -} {a::} -test filename-8.16 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join a {} b -} {:a:b} -test filename-8.17 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join a::: b -} {a:::b} -test filename-8.18 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join a : : : -} {:a} -test filename-8.19 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join : -} {:} -test filename-8.20 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join : a -} {:a} -test filename-8.21 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join a: :b/c -} {a:b/c} -test filename-8.22 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join :a :b/c -} {:a:b/c} - test filename-9.1 {Tcl_JoinPath: win} {testsetplatform} { testsetplatform win file join a b @@ -926,22 +523,6 @@ test filename-9.20 {Tcl_JoinPath: unix} {testsetplatform} { [file join /x {/foo/bar}] \ [file join /x /x {/foo/bar}] } {/foo/bar /foo/bar /foo/bar} -test filename-9.21 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - set res {} - lappend res \ - [file join {/foo/bar}] \ - [file join drive: {/foo/bar}] \ - [file join drive: drive: {/foo/bar}] -} {foo:bar foo:bar foo:bar} -test filename-9.22 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - set res {} - lappend res \ - [file join {foo:bar}] \ - [file join drive: {foo:bar}] \ - [file join drive: drive: {foo:bar}] -} {foo:bar foo:bar foo:bar} test filename-9.23 {Tcl_JoinPath: win} {testsetplatform} { testsetplatform win set res {} @@ -960,24 +541,6 @@ test filename-9.24 {Tcl_JoinPath: unix} {testsetplatform} { [file join /x /x {foo/bar}] string map [list /x ""] $res } {foo/bar /foo/bar /foo/bar} -test filename-9.25 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - set res {} - lappend res \ - [file join {foo/bar}] \ - [file join drive: {foo/bar}] \ - [file join drive: drive: {foo/bar}] - string map [list drive: ""] $res -} {:foo:bar foo:bar foo:bar} -test filename-9.26 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - set res {} - lappend res \ - [file join {:foo:bar}] \ - [file join drive: {:foo:bar}] \ - [file join drive: drive: {:foo:bar}] - string map [list drive: ""] $res -} {:foo:bar foo:bar foo:bar} test filename-10.1 {Tcl_TranslateFileName} {testsetplatform} { testsetplatform unix @@ -991,14 +554,6 @@ test filename-10.3 {Tcl_TranslateFileName} {testsetplatform} { testsetplatform windows list [catch {testtranslatefilename {c:/\\foo/}} msg] $msg } {0 {c:\foo}} -test filename-10.4 {Tcl_TranslateFileName} {testsetplatform} { - testsetplatform mac - list [catch {testtranslatefilename foo} msg] $msg -} {0 :foo} -test filename-10.5 {Tcl_TranslateFileName} {testsetplatform} { - testsetplatform mac - list [catch {testtranslatefilename :~foo} msg] $msg -} {0 :~foo} test filename-10.6 {Tcl_TranslateFileName} {testsetplatform} { global env set temp $env(HOME) @@ -1044,60 +599,6 @@ test filename-10.10 {Tcl_TranslateFileName} {testsetplatform} { set env(HOME) $temp set result } {0 /home/test/foo} -test filename-10.11 {Tcl_TranslateFileName} {testsetplatform} { - global env - set temp $env(HOME) - set env(HOME) "Root:" - testsetplatform mac - set result [list [catch {testtranslatefilename ~/foo} msg] $msg] - set env(HOME) $temp - set result -} {0 Root:foo} -test filename-10.12 {Tcl_TranslateFileName} {testsetplatform} { - global env - set temp $env(HOME) - set env(HOME) "Root:home" - testsetplatform mac - set result [list [catch {testtranslatefilename ~/foo} msg] $msg] - set env(HOME) $temp - set result -} {0 Root:home:foo} -test filename-10.13 {Tcl_TranslateFileName} {testsetplatform} { - global env - set temp $env(HOME) - set env(HOME) "Root:home" - testsetplatform mac - set result [list [catch {testtranslatefilename ~::foo} msg] $msg] - set env(HOME) $temp - set result -} {0 Root:home::foo} -test filename-10.14 {Tcl_TranslateFileName} {testsetplatform} { - global env - set temp $env(HOME) - set env(HOME) "Root:home" - testsetplatform mac - set result [list [catch {testtranslatefilename ~} msg] $msg] - set env(HOME) $temp - set result -} {0 Root:home} -test filename-10.15 {Tcl_TranslateFileName} {testsetplatform} { - global env - set temp $env(HOME) - set env(HOME) "Root:home:" - testsetplatform mac - set result [list [catch {testtranslatefilename ~::foo} msg] $msg] - set env(HOME) $temp - set result -} {0 Root:home::foo} -test filename-10.16 {Tcl_TranslateFileName} {testsetplatform} { - global env - set temp $env(HOME) - set env(HOME) "Root:home::" - testsetplatform mac - set result [list [catch {testtranslatefilename ~::foo} msg] $msg] - set env(HOME) $temp - set result -} {0 Root:home:::foo} test filename-10.17 {Tcl_TranslateFileName} {testsetplatform} { global env set temp $env(HOME) @@ -1249,7 +750,7 @@ test filename-11.17 {Tcl_GlobCmd} {unixOnly} { [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]]] -test filename-11.17.1 {Tcl_GlobCmd} {pcOnly macOnly} { +test filename-11.17.1 {Tcl_GlobCmd} {pcOnly} { list [catch {lsort [glob -directory $globname *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ @@ -1379,7 +880,7 @@ test filename-11.18 {Tcl_GlobCmd} {unixOnly} { [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]]] -test filename-11.18.1 {Tcl_GlobCmd} {pcOnly macOnly} { +test filename-11.18.1 {Tcl_GlobCmd} {pcOnly} { list [catch {lsort [glob -path $globname/ *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ @@ -1397,7 +898,7 @@ test filename-11.19 {Tcl_GlobCmd} {unixOnly} { [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]]] -test filename-11.19.1 {Tcl_GlobCmd} {pcOnly macOnly} { +test filename-11.19.1 {Tcl_GlobCmd} {pcOnly} { list [catch {lsort [glob -join -path \ [string range $globname 0 5] * *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ @@ -1439,7 +940,7 @@ test filename-11.22 {Tcl_GlobCmd} {unixOnly} { [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]]] -test filename-11.22.1 {Tcl_GlobCmd} {pcOnly macOnly} { +test filename-11.22.1 {Tcl_GlobCmd} {pcOnly} { list [catch {lsort [glob -dir $globname *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ @@ -1456,7 +957,7 @@ test filename-11.23 {Tcl_GlobCmd} {unixOnly} { [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]]] -test filename-11.23.1 {Tcl_GlobCmd} {pcOnly macOnly} { +test filename-11.23.1 {Tcl_GlobCmd} {pcOnly} { list [catch {lsort [glob -path $globname/ *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ @@ -1474,7 +975,7 @@ test filename-11.24 {Tcl_GlobCmd} {unixOnly} { [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]]] -test filename-11.24.1 {Tcl_GlobCmd} {pcOnly macOnly} { +test filename-11.24.1 {Tcl_GlobCmd} {pcOnly} { list [catch {lsort [glob -join -path \ [string range $globname 0 5] * *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ @@ -1614,27 +1115,11 @@ test filename-12.1.5 {simple globbing} {pcOnly} { test filename-12.1.6 {simple globbing} {pcOnly} { list [catch {glob c:/} msg] $msg } {0 c:/} -test filename-12.2 {simple globbing} {macOnly} { - list [catch {glob {}} msg] $msg -} {0 :} -test filename-12.2.1 {simple globbing} {macOnly} { - list [catch {glob -types f {}} msg] $msg -} {1 {no files matched glob pattern ""}} -test filename-12.2.2 {simple globbing} {macOnly} { - list [catch {glob -types d {}} msg] $msg -} {0 :} -test filename-12.2.3 {simple globbing} {macOnly} { - list [catch {glob -types hidden {}} msg] $msg -} {1 {no files matched glob pattern ""}} test filename-12.3 {simple globbing} { list [catch {glob -nocomplain \{a1,a2\}} msg] $msg } {0 {}} -if {$tcl_platform(platform) == "macintosh"} { - set globPreResult :globTest: -} else { set globPreResult globTest/ -} set x1 x1.c set y1 y1.c test filename-12.4 {simple globbing} {unixOrPc} { @@ -1713,36 +1198,21 @@ test filename-13.10 {globbing with brace substitution} { test filename-13.11 {globbing with brace substitution} {unixOrPc} { list [lsort [catch {glob globTest/\{x,x\\,z,z\}1.c} msg]] $msg } {0 {globTest/x1.c globTest/x,z1.c globTest/z1.c}} -test filename-13.12 {globbing with brace substitution} {macOnly} { - list [lsort [catch {glob globTest/\{x,x\\,z,z\}1.c} msg]] $msg -} {0 {:globTest:x1.c :globTest:x,z1.c :globTest:z1.c}} test filename-13.13 {globbing with brace substitution} { lsort [glob globTest/{a,b,x,y}1.c] } [list $globPreResult$x1 $globPreResult$y1] test filename-13.14 {globbing with brace substitution} {unixOrPc} { lsort [glob {globTest/{x1,y2,weird name}.c}] } {{globTest/weird name.c} globTest/x1.c} -test filename-13.15 {globbing with brace substitution} {macOnly} { - lsort [glob {globTest/{x1,y2,weird name}.c}] -} {{:globTest:weird name.c} :globTest:x1.c} test filename-13.16 {globbing with brace substitution} {unixOrPc} { lsort [glob globTest/{x1.c,a1/*}] } {globTest/a1/b1 globTest/a1/b2 globTest/x1.c} -test filename-13.17 {globbing with brace substitution} {macOnly} { - lsort [glob globTest/{x1.c,a1/*}] -} {:globTest:a1:b1 :globTest:a1:b2 :globTest:x1.c} test filename-13.18 {globbing with brace substitution} {unixOrPc} { lsort [glob globTest/{x1.c,{a},a1/*}] } {globTest/a1/b1 globTest/a1/b2 globTest/x1.c} -test filename-13.19 {globbing with brace substitution} {macOnly} { - lsort [glob globTest/{x1.c,{a},a1/*}] -} {:globTest:a1:b1 :globTest:a1:b2 :globTest:x1.c} test filename-13.20 {globbing with brace substitution} {unixOrPc} { lsort [glob globTest/{a,x}1/*/{x,y}*] } {globTest/a1/b1/x2.c globTest/a1/b2/y2.c} -test filename-13.21 {globbing with brace substitution} {macOnly} { - lsort [glob globTest/{a,x}1/*/{x,y}*] -} {:globTest:a1:b1:x2.c :globTest:a1:b2:y2.c} test filename-13.22 {globbing with brace substitution} { list [catch {glob globTest/\{a,x\}1/*/\{} msg] $msg } {1 {unmatched open-brace in file name}} @@ -1750,15 +1220,9 @@ test filename-13.22 {globbing with brace substitution} { test filename-14.1 {asterisks, question marks, and brackets} {unixOrPc} { lsort [glob glo*/*.c] } {{globTest/weird name.c} globTest/x,z1.c globTest/x1.c globTest/y1.c globTest/z1.c} -test filename-14.2 {asterisks, question marks, and brackets} {macOnly} { - lsort [glob glo*/*.c] -} {{:globTest:weird name.c} :globTest:x,z1.c :globTest:x1.c :globTest:y1.c :globTest:z1.c} test filename-14.3 {asterisks, question marks, and brackets} {unixOrPc} { lsort [glob globTest/?1.c] } {globTest/x1.c globTest/y1.c globTest/z1.c} -test filename-14.4 {asterisks, question marks, and brackets} {macOnly} { - lsort [glob globTest/?1.c] -} {:globTest:x1.c :globTest:y1.c :globTest:z1.c} # The current directory could be anywhere; do this to stop spurious matches file mkdir globTestContext @@ -1769,9 +1233,6 @@ cd globTestContext test filename-14.5 {asterisks, question marks, and brackets} {unixOrPc} { lsort [glob */*/*/*.c] } {globTest/a1/b1/x2.c globTest/a1/b2/y2.c} -test filename-14.6 {asterisks, question marks, and brackets} {macOnly} { - lsort [glob */*/*/*.c] -} {:globTest:a1:b1:x2.c :globTest:a1:b2:y2.c} # Reset to where we were cd $savepwd @@ -1784,33 +1245,18 @@ test filename-14.7 {asterisks, question marks, and brackets} {unixOnly} { test filename-14.7.1 {asterisks, question marks, and brackets} {pcOnly} { lsort [glob globTest/*] } {globTest/.1 globTest/a1 globTest/a2 globTest/a3 {globTest/weird name.c} globTest/x,z1.c globTest/x1.c globTest/y1.c globTest/z1.c} -test filename-14.8 {asterisks, question marks, and brackets} {macOnly} { - lsort [glob globTest/*] -} {:globTest:.1 :globTest:a1 :globTest:a2 :globTest:a3 {:globTest:weird name.c} :globTest:x,z1.c :globTest:x1.c :globTest:y1.c :globTest:z1.c} test filename-14.9 {asterisks, question marks, and brackets} {unixOrPc} { lsort [glob globTest/.*] } {globTest/. globTest/.. globTest/.1} -test filename-14.10 {asterisks, question marks, and brackets} {macOnly} { - lsort [glob globTest/.*] -} {:globTest:.1} test filename-14.11 {asterisks, question marks, and brackets} {unixOrPc} { lsort [glob globTest/*/*] } {globTest/a1/b1 globTest/a1/b2 globTest/a2/b3} -test filename-14.12 {asterisks, question marks, and brackets} {macOnly} { - lsort [glob globTest/*/*] -} {:globTest:a1:b1 :globTest:a1:b2 :globTest:a2:b3} test filename-14.13 {asterisks, question marks, and brackets} {unixOrPc} { lsort [glob {globTest/[xyab]1.*}] } {globTest/x1.c globTest/y1.c} -test filename-14.14 {asterisks, question marks, and brackets} {macOnly} { - lsort [glob {globTest/[xyab]1.*}] -} {:globTest:x1.c :globTest:y1.c} test filename-14.15 {asterisks, question marks, and brackets} {unixOrPc} { lsort [glob globTest/*/] } {globTest/a1/ globTest/a2/ globTest/a3/} -test filename-14.16 {asterisks, question marks, and brackets} {macOnly} { - lsort [glob globTest/*/] -} {:globTest:a1: :globTest:a2: :globTest:a3:} test filename-14.17 {asterisks, question marks, and brackets} { global env set temp $env(HOME) @@ -1822,9 +1268,6 @@ test filename-14.17 {asterisks, question marks, and brackets} { test filename-14.18 {asterisks, question marks, and brackets} {unixOrPc} { list [catch {lsort [glob globTest/*.c goo/*]} msg] $msg } {0 {{globTest/weird name.c} globTest/x,z1.c globTest/x1.c globTest/y1.c globTest/z1.c}} -test filename-14.19 {asterisks, question marks, and brackets} {macOnly} { - list [catch {lsort [glob globTest/*.c goo/*]} msg] $msg -} {0 {{:globTest:weird name.c} :globTest:x,z1.c :globTest:x1.c :globTest:y1.c :globTest:z1.c}} test filename-14.20 {asterisks, question marks, and brackets} { list [catch {glob -nocomplain goo/*} msg] $msg } {0 {}} @@ -1847,14 +1290,6 @@ test filename-14.25 {type specific globbing} {unixOnly} { [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]]] -test filename-14.25.1 {type specific globbing} {pcOnly macOnly} { - list [catch {lsort [glob -dir globTest -types f *]} msg] $msg -} [list 0 [lsort [list \ - [file join $globname .1]\ - [file join $globname "weird name.c"]\ - [file join $globname x,z1.c]\ - [file join $globname x1.c]\ - [file join $globname y1.c] [file join $globname z1.c]]]] test filename-14.26 {type specific globbing} { list [catch {glob -nocomplain -dir globTest -types {readonly} *} msg] $msg } [list 0 {}] diff --git a/tests/interp.test b/tests/interp.test index ff38301..8580446 100644 --- a/tests/interp.test +++ b/tests/interp.test @@ -15,13 +15,7 @@ if {[lsearch [namespace children] ::tcltest] == -1} { namespace import -force ::tcltest::* } -# The set of hidden commands is platform dependent: - -if {"$tcl_platform(platform)" == "macintosh"} { - set hidden_cmds {beep cd echo encoding exit fconfigure file glob load ls open pwd socket source} -} else { - set hidden_cmds {cd encoding exec exit fconfigure file glob load open pwd socket source} -} +set hidden_cmds {cd encoding exec exit fconfigure file glob load open pwd socket source} foreach i [interp slaves] { interp delete $i @@ -1742,24 +1736,6 @@ test interp-23.2 {testing hiding vs aliases} {unixOrPc} { set l } {{cd encoding exec exit fconfigure file glob load open pwd socket source} bar {cd encoding exec exit fconfigure file glob load open pwd socket source} bar {bar cd encoding exec exit fconfigure file glob load open pwd socket source} {} {cd encoding exec exit fconfigure file glob load open pwd socket source}} -test interp-23.3 {testing hiding vs aliases} {macOnly} { - catch {interp delete a} - interp create a -safe - set l "" - lappend l [lsort [interp hidden a]] - a alias bar bar - lappend l [interp aliases a] - lappend l [lsort [interp hidden a]] - a hide bar - lappend l [interp aliases a] - lappend l [lsort [interp hidden a]] - a alias bar {} - lappend l [interp aliases a] - lappend l [lsort [interp hidden a]] - interp delete a - set l -} {{beep cd echo encoding exit fconfigure file glob load ls open pwd socket source} bar {beep cd echo encoding exit fconfigure file glob load ls open pwd socket source} bar {bar beep cd echo encoding exit fconfigure file glob load ls open pwd socket source} {} {beep cd echo encoding exit fconfigure file glob load ls open pwd socket source}} - test interp-24.1 {result resetting on error} { catch {interp delete a} interp create a diff --git a/tests/io.test b/tests/io.test index ed2619a..718ce7e 100644 --- a/tests/io.test +++ b/tests/io.test @@ -1609,11 +1609,7 @@ test io-13.12 {TranslateInputEOL: find EOF char in src} { # also testing channel table management. if {[info commands testchannel] != ""} { - if {$tcl_platform(platform) == "macintosh"} { - set consoleFileNames [list console0 console1 console2] - } else { - set consoleFileNames [lsort [testchannel open]] - } + set consoleFileNames [lsort [testchannel open]] } else { # just to avoid an error set consoleFileNames [list] @@ -1936,12 +1932,6 @@ test io-20.3 {Tcl_CreateChannel: initial settings} {unixOnly} { close $f set x } {{{} {}} {auto lf}} -test io-20.4 {Tcl_CreateChannel: initial settings} {macOnly} { - set f [open $path(test1) w+] - set x [list [fconfigure $f -eofchar] [fconfigure $f -translation]] - close $f - set x -} {{{} {}} {auto cr}} set path(stdout) [makeFile {} stdout] diff --git a/tests/load.test b/tests/load.test index 4794bd1..963516e 100644 --- a/tests/load.test +++ b/tests/load.test @@ -18,12 +18,6 @@ if {[lsearch [namespace children] ::tcltest] == -1} { # Figure out what extension is used for shared libraries on this # platform. -if {$tcl_platform(platform) == "macintosh"} { - puts "can't run dynamic library tests on macintosh machines" - ::tcltest::cleanupTests - return -} - # Tests require the existence of one of the DLLs in the dltest directory. set ext [info sharedlibextension] set testDir [file join [file dirname [info nameofexecutable]] dltest] diff --git a/tests/macFCmd.test b/tests/macFCmd.test deleted file mode 100644 index c35b793..0000000 --- a/tests/macFCmd.test +++ /dev/null @@ -1,200 +0,0 @@ -# This file tests the tclfCmd.c file. -# -# This file contains a collection of tests for one or more of the Tcl -# built-in commands. Sourcing this file into Tcl runs the tests and -# generates output for errors. No output means no errors were found. -# -# Copyright (c) 1997 Sun Microsystems, Inc. -# Copyright (c) 1998-1999 by Scriptics Corporation. -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. - -if {[lsearch [namespace children] ::tcltest] == -1} { - package require tcltest - namespace import -force ::tcltest::* -} - -# These tests really need to be run from a writable directory, which -# it is assumed [temporaryDirectory] is. -set oldcwd [pwd] -cd [temporaryDirectory] - -catch {file delete -force foo.dir} -file mkdir foo.dir -if {[catch {file attributes foo.dir -readonly 1}]} { - set ::tcltest::testConstraints(fileSharing) 0 - set ::tcltest::testConstraints(notFileSharing) 1 -} else { - set ::tcltest::testConstraints(fileSharing) 1 - set ::tcltest::testConstraints(notFileSharing) 0 -} -file delete -force foo.dir - -test macFCmd-1.1 {GetFileFinderAttributes - no file} {macOnly} { - catch {file delete -force foo.file} - list [catch {file attributes foo.file -creator} msg] $msg -} {1 {could not read "foo.file": no such file or directory}} -test macFCmd-1.2 {GetFileFinderAttributes - creator} {macOnly} { - catch {file delete -force foo.file} - catch {close [open foo.file w]} - list [catch {file attributes foo.file -creator} msg] \ - [regexp {MPW |CWIE} $msg] [file delete -force foo.file] -} {0 1 {}} -test macFCmd-1.3 {GetFileFinderAttributes - type} {macOnly} { - catch {file delete -force foo.file} - catch {close [open foo.file w]} - list [catch {file attributes foo.file -type} msg] $msg \ - [file delete -force foo.file] -} {0 TEXT {}} -test macFCmd-1.4 {GetFileFinderAttributes - not hidden} {macOnly} { - catch {file delete -force foo.file} - catch {close [open foo.file w]} - list [catch {file attributes foo.file -hidden} msg] $msg \ - [file delete -force foo.file] -} {0 0 {}} -test macFCmd-1.5 {GetFileFinderAttributes - hidden} {macOnly} { - catch {file delete -force foo.file} - catch {close [open foo.file w]} - file attributes foo.file -hidden 1 - list [catch {file attributes foo.file -hidden} msg] $msg \ - [file delete -force foo.file] -} {0 1 {}} -test macFCmd-1.6 {GetFileFinderAttributes - folder creator} {macOnly} { - catch {file delete -force foo.dir} - file mkdir foo.dir - list [catch {file attributes foo.dir -creator} msg] $msg \ - [file delete -force foo.dir] -} {0 Fldr {}} -test macFCmd-1.7 {GetFileFinderAttributes - folder type} {macOnly} { - catch {file delete -force foo.dir} - file mkdir foo.dir - list [catch {file attributes foo.dir -type} msg] $msg \ - [file delete -force foo.dir] -} {0 Fldr {}} -test macFCmd-1.8 {GetFileFinderAttributes - folder hidden} {macOnly} { - catch {file delete -force foo.dir} - file mkdir foo.dir - list [catch {file attributes foo.dir -hidden} msg] $msg \ - [file delete -force foo.dir] -} {0 0 {}} - -test macFCmd-2.1 {GetFileReadOnly - bad file} {macOnly} { - catch {file delete -force foo.file} - list [catch {file attributes foo.file -readonly} msg] $msg -} {1 {could not read "foo.file": no such file or directory}} -test macFCmd-2.2 {GetFileReadOnly - file not read only} {macOnly} { - catch {file delete -force foo.file} - close [open foo.file w] - list [catch {file attributes foo.file -readonly} msg] $msg \ - [file delete -force foo.file] -} {0 0 {}} -test macFCmd-2.3 {GetFileReadOnly - file read only} {macOnly} { - catch {file delete -force foo.file} - close [open foo.file w] - file attributes foo.file -readonly 1 - list [catch {file attributes foo.file -readonly} msg] $msg \ - [file delete -force foo.file] -} {0 1 {}} -test macFCmd-2.4 {GetFileReadOnly - directory not read only} {macOnly} { - catch {file delete -force foo.dir} - file mkdir foo.dir - list [catch {file attributes foo.dir -readonly} msg] $msg \ - [file delete -force foo.dir] -} {0 0 {}} -test macFCmd-2.5 {GetFileReadOnly - directory read only} {macOnly fileSharing} { - catch {file delete -force foo.dir} - file mkdir foo.dir - file attributes foo.dir -readonly 1 - list [catch {file attributes foo.dir -readonly} msg] $msg \ - [file delete -force foo.dir] -} {0 1 {}} - -test macFCmd-3.1 {SetFileFinderAttributes - bad file} {macOnly} { - catch {file delete -force foo.file} - list [catch {file attributes foo.file -creator FOOO} msg] $msg -} {1 {could not read "foo.file": no such file or directory}} -test macFCmd-3.2 {SetFileFinderAttributes - creator} {macOnly} { - catch {file delete -force foo.file} - close [open foo.file w] - list [catch {file attributes foo.file -creator FOOO} msg] $msg \ - [file attributes foo.file -creator] [file delete -force foo.file] -} {0 {} FOOO {}} -test macFCmd-3.3 {SetFileFinderAttributes - bad creator} {macOnly} { - catch {file delete -force foo.file} - close [open foo.file w] - list [catch {file attributes foo.file -creator 0} msg] $msg \ - [file delete -force foo.file] -} {1 {expected Macintosh OS type but got "0"} {}} -test macFCmd-3.4 {SetFileFinderAttributes - hidden} {macOnly} { - catch {file delete -force foo.file} - close [open foo.file w] - list [catch {file attributes foo.file -hidden 1} msg] $msg \ - [file attributes foo.file -hidden] [file delete -force foo.file] -} {0 {} 1 {}} -test macFCmd-3.5 {SetFileFinderAttributes - type} {macOnly} { - catch {file delete -force foo.file} - close [open foo.file w] - list [catch {file attributes foo.file -type FOOO} msg] $msg \ - [file attributes foo.file -type] [file delete -force foo.file] -} {0 {} FOOO {}} -test macFCmd-3.6 {SetFileFinderAttributes - bad type} {macOnly} { - catch {file delete -force foo.file} - close [open foo.file w] - list [catch {file attributes foo.file -type 0} msg] $msg \ - [file delete -force foo.file] -} {1 {expected Macintosh OS type but got "0"} {}} -test macFCmd-3.7 {SetFileFinderAttributes - directory} {macOnly} { - catch {file delete -force foo.dir} - file mkdir foo.dir - list [catch {file attributes foo.dir -creator FOOO} msg] \ - $msg [file delete -force foo.dir] -} {1 {cannot set -creator: "foo.dir" is a directory} {}} - -test macFCmd-4.1 {SetFileReadOnly - bad file} {macOnly} { - catch {file delete -force foo.file} - list [catch {file attributes foo.file -readonly 1} msg] $msg -} {1 {could not read "foo.file": no such file or directory}} -test macFCmd-4.2 {SetFileReadOnly - file not readonly} {macOnly} { - catch {file delete -force foo.file} - close [open foo.file w] - list [catch {file attributes foo.file -readonly 0} msg] \ - $msg [file attributes foo.file -readonly] [file delete -force foo.file] -} {0 {} 0 {}} -test macFCmd-4.3 {SetFileReadOnly - file readonly} {macOnly} { - catch {file delete -force foo.file} - close [open foo.file w] - list [catch {file attributes foo.file -readonly 1} msg] \ - $msg [file attributes foo.file -readonly] [file delete -force foo.file] -} {0 {} 1 {}} -test macFCmd-4.4 {SetFileReadOnly - directory not readonly} \ - {macOnly fileSharing} { - catch {file delete -force foo.dir} - file mkdir foo.dir - list [catch {file attributes foo.dir -readonly 0} msg] \ - $msg [file attributes foo.dir -readonly] [file delete -force foo.dir] -} {0 {} 0 {}} -test macFCmd-4.5 {SetFileReadOnly - directory not readonly} \ - {macOnly notFileSharing} { - catch {file delete -force foo.dir} - file mkdir foo.dir - list [catch {file attributes foo.dir -readonly 0} msg] $msg \ - [file delete -force foo.dir] -} {1 {cannot set a directory to read-only when File Sharing is turned off} {}} -test macFCmd-4.6 {SetFileReadOnly - directory readonly} {macOnly fileSharing} { - catch {file delete -force foo.dir} - file mkdir foo.dir - list [catch {file attributes foo.dir -readonly 1} msg] $msg \ - [file attributes foo.dir -readonly] [file delete -force foo.dir] -} {0 {} 1 {}} -test macFCmd-4.7 {SetFileReadOnly - directory readonly} {macOnly notFileSharing} { - catch {file delete -force foo.dir} - file mkdir foo.dir - list [catch {file attributes foo.dir -readonly 1} msg] $msg \ - [file delete -force foo.dir] -} {1 {cannot set a directory to read-only when File Sharing is turned off} {}} - -# cleanup -cd $oldcwd -::tcltest::cleanupTests -return diff --git a/tests/osa.test b/tests/osa.test deleted file mode 100644 index 0fc722c..0000000 --- a/tests/osa.test +++ /dev/null @@ -1,46 +0,0 @@ -# Commands covered: AppleScript -# -# This file contains a collection of tests for one or more of the Tcl -# built-in commands. Sourcing this file into Tcl runs the tests and -# generates output for errors. No output means no errors were found. -# -# Copyright (c) 1997 Sun Microsystems, Inc. -# Copyright (c) 1998-1999 by Scriptics Corporation. -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. - -if {[lsearch [namespace children] ::tcltest] == -1} { - package require tcltest - namespace import -force ::tcltest::* -} - -# Only run the test if we can load the AppleScript command -set ::tcltest::testConstraints(appleScript) [expr {[info commands AppleScript] != ""}] - -test osa-1.1 {Tcl_OSAComponentCmd} {macOnly appleScript} { - list [catch AppleScript msg] $msg -} {1 {wrong # args: should be "AppleScript option ?arg ...?"}} -test osa-1.2 {Tcl_OSAComponentCmd} {macOnly appleScript} { - list [catch {AppleScript x} msg] $msg -} {1 {bad option "x": should be compile, decompile, delete, execute, info, load, run or store}} - -test osa-1.3 {TclOSACompileCmd} {macOnly appleScript} { - list [catch {AppleScript compile} msg] $msg -} {1 {wrong # args: should be "AppleScript compile ?options? code"}} - -# cleanup -::tcltest::cleanupTests -return - - - - - - - - - - - - diff --git a/tests/resource.test b/tests/resource.test deleted file mode 100644 index 3ae24e2..0000000 --- a/tests/resource.test +++ /dev/null @@ -1,363 +0,0 @@ -# Commands covered: resource -# -# This file contains a collection of tests for one or more of the Tcl -# built-in commands. Sourcing this file into Tcl runs the tests and -# generates output for errors. No output means no errors were found. -# -# Copyright (c) 1996-1997 Sun Microsystems, Inc. -# Copyright (c) 1998-1999 by Scriptics Corporation. -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. - -if {[lsearch [namespace children] ::tcltest] == -1} { - package require tcltest - namespace import -force ::tcltest::* -} - -test resource-1.1 {resource tests} {macOnly} { - list [catch {resource} msg] $msg -} {1 {wrong # args: should be "resource option ?arg ...?"}} -test resource-1.2 {resource tests} {macOnly} { - list [catch {resource _bad_} msg] $msg -} {1 {bad option "_bad_": must be close, delete, files, list, open, read, types, or write}} - -# resource open & close tests -test resource-2.1 {resource open & close tests} {macOnly} { - list [catch {resource open} msg] $msg -} {1 {wrong # args: should be "resource open fileName ?permissions?"}} -test resource-2.2 {resource open & close tests} {macOnly} { - list [catch {resource open resource.test r extraArg} msg] $msg -} {1 {wrong # args: should be "resource open fileName ?permissions?"}} -test resource-2.3 {resource open & close tests} {macOnly} { - list [catch {resource open resource.test bad_perms} msg] $msg -} {1 {illegal access mode "bad_perms"}} -test resource-2.4 {resource open & close tests} {macOnly} { - list [catch {resource open _bad_file_} msg] $msg -} {1 {file does not exist}} -test resource-2.5 {resource open & close tests} {macOnly} { - testWriteTextResource -rsrc fileRsrcName -file rsrc.file {error "don't source me"} - set id [resource open rsrc.file] - resource close $id - file delete rsrc.file -} {} -test resource-2.6 {resource open & close tests} {macOnly} { - catch {file delete rsrc.file} - testWriteTextResource -rsrc fileRsrcName -file rsrc.file {A test string} - set id [resource open rsrc.file] - set result [string compare [resource open rsrc.file] $id] - lappend result [resource read TEXT fileRsrcName $id] - resource close $id - file delete rsrc.file - set result -} {0 {A test string}} -test resource-2.7 {resource open & close tests} {macOnly} { - catch {file delete rsrc.file} - testWriteTextResource -rsrc fileRsrcName -file rsrc.file {error "don't source me"} - set id [resource open rsrc.file r] - set result [catch {resource open rsrc.file w} mssg] - resource close $id - file delete rsrc.file - lappend result $mssg - set result -} {1 {Resource already open with different permissions.}} -test resource-2.8 {resource open & close tests} {macOnly} { - list [catch {resource close} msg] $msg -} {1 {wrong # args: should be "resource close resourceRef"}} -test resource-2.9 {resource open & close tests} {macOnly} { - list [catch {resource close foo bar} msg] $msg -} {1 {wrong # args: should be "resource close resourceRef"}} -test resource-2.10 {resource open & close tests} {macOnly} { - list [catch {resource close _bad_resource_} msg] $msg -} {1 {invalid resource file reference "_bad_resource_"}} -test resource-2.11 {resource open & close tests} {macOnly} { - set result [catch {resource close System} mssg] - lappend result $mssg -} {1 {can't close "System" resource file}} -test resource-2.12 {resource open & close tests} {macOnly} { - set result [catch {resource close application} mssg] - lappend result $mssg -} {1 {can't close "application" resource file}} - -# Tests for listing resources -test resource-3.1 {resource list tests} {macOnly} { - list [catch {resource list} msg] $msg -} {1 {wrong # args: should be "resource list resourceType ?resourceRef?"}} -test resource-3.2 {resource list tests} {macOnly} { - list [catch {resource list _bad_type_} msg] $msg -} {1 {expected Macintosh OS type but got "_bad_type_"}} -test resource-3.3 {resource list tests} {macOnly} { - list [catch {resource list TEXT _bad_ref_} msg] $msg -} {1 {invalid resource file reference "_bad_ref_"}} -test resource-3.4 {resource list tests} {macOnly} { - list [catch {resource list TEXT _bad_ref_ extraArg} msg] $msg -} {1 {wrong # args: should be "resource list resourceType ?resourceRef?"}} -test resource-3.5 {resource list tests} {macOnly} { - catch {file delete rsrc.file} - testWriteTextResource -rsrc fileRsrcName -file rsrc.file {error "don't source me"} - set id [resource open rsrc.file] - catch "resource list TEXT $id" result - resource close $id - set result -} {fileRsrcName} -test resource-3.6 {resource list tests} {macOnly} { - # There should not be any resource of this type - resource list XXXX -} {} -test resource-3.7 {resource list tests} {macOnly} { - set resourceList [resource list STR#] - if {[lsearch $resourceList {Tcl Environment Variables}] == -1} { - set result {couldn't find resource that should exist} - } else { - set result ok - } -} {ok} - -# Tests for reading resources -test resource-4.1 {resource read tests} {macOnly} { - list [catch {resource read} msg] $msg -} {1 {wrong # args: should be "resource read resourceType resourceId ?resourceRef?"}} -test resource-4.2 {resource read tests} {macOnly} { - list [catch {resource read TEXT} msg] $msg -} {1 {wrong # args: should be "resource read resourceType resourceId ?resourceRef?"}} -test resource-4.3 {resource read tests} {macOnly} { - list [catch {resource read STR# {_non_existant_resource_}} msg] $msg -} {1 {could not load resource}} -test resource-4.4 {resource read tests} {macOnly} { - # The following resource should exist and load OK without error - catch {resource read STR# {Tcl Environment Variables}} -} {0} - -# Tests for getting resource types -test resource-5.1 {resource types tests} {macOnly} { - list [catch {resource types _bad_ref_} msg] $msg -} {1 {invalid resource file reference "_bad_ref_"}} -test resource-5.2 {resource types tests} {macOnly} { - list [catch {resource types _bad_ref_ extraArg} msg] $msg -} {1 {wrong # args: should be "resource types ?resourceRef?"}} -test resource-5.3 {resource types tests} {macOnly} { - # This should never cause an error - catch {resource types} -} {0} -test resource-5.4 {resource types tests} {macOnly} { - testWriteTextResource -rsrc fileRsrcName -file rsrc.file {error "don't source me"} - set id [resource open rsrc.file] - set result [resource types $id] - resource close $id - set result -} {TEXT} - -# resource write tests -test resource-6.1 {resource write tests} {macOnly} { - list [catch {resource write} msg] $msg -} {1 {wrong # args: should be "resource write ?-id resourceId? ?-name resourceName? ?-file resourceRef? ?-force? resourceType data"}} -test resource-6.2 {resource write tests} {macOnly} { - list [catch {resource write _bad_type_ data} msg] $msg -} {1 {expected Macintosh OS type but got "_bad_type_"}} -test resource-6.3 {resource write tests} {macOnly} { - catch {file delete rsrc2.file} - set id [resource open rsrc2.file w] - resource close $id - set id [resource open rsrc2.file r] - set result [catch {resource write -file $id -name Hello TEXT foo} errMsg] - lappend result [string compare $errMsg "cannot write to resource file \"$id\", it was opened read only"] - lappend result [lsearch [resource list TEXT $id] Hello] - resource close $id - file delete rsrc2.file - set result -} {1 0 -1} -test resource-6.4 {resource write tests} {macOnly} { - catch {file delete rsrc2.file} - set id [resource open rsrc2.file w] - resource write -file $id -name Hello TEXT {set x "our test data"} - source -rsrc Hello rsrc2.file - resource close $id - file delete rsrc2.file - set x -} {our test data} -test resource-6.5 {resource write tests} {macOnly} { - catch {file delete rsrc2.file} - set id [resource open rsrc2.file w] - resource write -file $id -id 256 TEXT {HAHAHAHAHAHAHA} - set result [catch {resource write -file $id -id 256 TEXT {HOHOHOHOHOHO}} mssg] - resource close $id - file delete rsrc2.file - lappend result $mssg -} {1 {the resource 256 already exists, use "-force" to overwrite it.}} -test resource-6.6 {resource write tests} {macOnly} { - catch {file delete rsrc2.file} - testWriteTextResource -rsrc fileRsrcName -rsrcid 256 -file rsrc2.file -protected {error "don't tread on me"} - set id [resource open rsrc2.file w] - set result [catch {resource write -id 256 -force -file $id TEXT {NAHNAHNANAHNAH}} mssg] - resource close $id - file delete rsrc2.file - lappend result $mssg -} {1 {could not write resource id 256 of type TEXT, it was protected.}} -test resource-6.7 {resource write tests} {macOnly} { - catch {file delete rsrc2.file} - set id [resource open rsrc2.file w] - resource write -file $id -id 256 -name FOO TEXT {set x [list "our first test data"]} - resource write -file $id -id 256 -name BAR -force TEXT {set x [list "our second test data"]} - source -rsrcid 256 rsrc2.file - lappend x [resource list TEXT $id] - resource close $id - file delete rsrc2.file - set x -} {{our second test data} BAR} - -#Tests for listing open resource files -test resource-7.1 {resource file tests} {macOnly} { - catch {resource files foo bar} mssg - set mssg -} {wrong # args: should be "resource files ?resourceId?"} -test resource-7.2 {resource file tests} {macOnly} { - catch {file delete rsrc2.file} - set rsrcFiles [resource files] - set id [resource open rsrc2.file w] - set result [string compare $rsrcFiles [lrange [resource files] 1 end]] - lappend result [string compare $id [lrange [resource files] 0 0]] - resource close $id - file delete rsrc2.file - set result -} {0 0} -test resource-7.3 {resource file tests} {macOnly} { - set result 0 - foreach file [resource files] { - if {[catch {resource types $file}] != 0} { - set result 1 - } - } - set result -} {0} -test resource-7.4 {resource file tests} {macOnly} { - catch {resource files __NO_SUCH_RESOURCE__} mssg - set mssg -} {invalid resource file reference "__NO_SUCH_RESOURCE__"} -test resource-7.5 {resource file tests} {macOnly} { - set sys [resource files System] - string compare $sys [file join $env(SYS_FOLDER) System] -} {0} -test resource-7.6 {resource file tests} {macOnly} { - set app [resource files application] - string compare $app [info nameofexecutable] -} {0} - -#Tests for the resource delete command -test resource-8.1 {resource delete tests} {macOnly} { - list [catch {resource delete} msg] $msg -} {1 {wrong # args: should be "resource delete ?-id resourceId? ?-name resourceName? ?-file resourceRef? resourceType"}} -test resource-8.2 {resource delete tests} {macOnly} { - list [catch {resource delete TEXT} msg] $msg -} {1 {you must specify either "-id" or "-name" or both to "resource delete"}} -test resource-8.3 {resource delete tests} {macOnly} { - set result [catch {resource delete -file ffffff -id 128 TEXT} mssg] - lappend result $mssg -} {1 {invalid resource file reference "ffffff"}} -test resource-8.4 {resource delete tests} {macOnly} { - catch {file delete rsrc2.file} - testWriteTextResource -rsrc fileRsrcName -rsrcid 128 -file rsrc2.file {Some stuff} - set id [resource open rsrc2.file r] - set result [catch {resource delete -id 128 -file $id TEXT} mssg] - resource close $id - file delete rsrc2.file - lappend result [string compare $mssg "cannot delete from resource file \"$id\", it was opened read only"] -} {1 0} -test resource-8.5 {resource delete tests} {macOnly} { - catch {file delete rsrc2.file} - testWriteTextResource -rsrc fileRsrcName -rsrcid 128 -file rsrc2.file {Some stuff} - set id [resource open rsrc2.file w] - set result [catch {resource delete -id 128 -file $id _bad_type_} mssg] - resource close $id - file delete rsrc2.file - lappend result $mssg -} {1 {expected Macintosh OS type but got "_bad_type_"}} -test resource-8.5.1 {resource delete tests} {macOnly} { - catch {file delete rsrc2.file} - set id [resource open rsrc2.file w] - set result [catch {resource delete -id 128 -file $id TEXT} mssg] - resource close $id - file delete rsrc2.file - lappend result $mssg -} {1 {resource not found}} -test resource-8.6 {resource delete tests} {macOnly} { - catch {file delete rsrc2.file} - set id [resource open rsrc2.file w] - set result [catch {resource delete -name foo -file $id TEXT} mssg] - resource close $id - file delete rsrc2.file - lappend result $mssg -} {1 {resource not found}} -test resource-8.7 {resource delete tests} {macOnly} { - catch {file delete rsrc2.file} - set id [resource open rsrc2.file w] - resource write -file $id -name foo -id 128 TEXT {some stuff} - resource write -file $id -name bar -id 129 TEXT {some stuff} - set result [catch {resource delete -name foo -id 129 -file $id TEXT} mssg] - resource close $id - file delete rsrc2.file - lappend result $mssg -} {1 {"-id" and "-name" values do not point to the same resource}} -test resource-8.8 {resource delete tests} {macOnly} { - catch {file delete rsrc2.file} - testWriteTextResource -rsrc fileRsrcName -rsrcid 256 -file rsrc2.file -protected {error "don't tread on me"} - set id [resource open rsrc2.file w] - set result [catch {resource delete -id 256 -file $id TEXT } mssg] - resource close $id - file delete rsrc2.file - lappend result $mssg -} {1 {resource cannot be deleted: it is protected.}} -test resource-8.9 {resource delete tests} {macOnly} { - catch {file delete rsrc2.file} - testWriteTextResource -rsrc fileRsrcName -rsrcid 128 -file rsrc2.file {Some stuff} - set id [resource open rsrc2.file w] - set result [resource list TEXT $id] - resource delete -id 128 -file $id TEXT - lappend result [resource list TEXT $id] - resource close $id - file delete rsrc2.file - set result -} {fileRsrcName {}} - -# Tests for the Mac version of the source command -catch {file delete rsrc.file} -test resource-9.1 {source command} {macOnly} { - testWriteTextResource -rsrc fileRsrcName -rsrcid 128 \ - -file rsrc.file {set rsrc_foo 1} - catch {unset rsrc_foo} - source -rsrc fileRsrcName rsrc.file - list [catch {set rsrc_foo} msg] $msg -} {0 1} -test resource-9.2 {source command} {macOnly} { - catch {unset rsrc_foo} - list [catch {source -rsrc no_resource rsrc.file} msg] $msg -} {1 {The resource "no_resource" could not be loaded from rsrc.file.}} -test resource-9.3 {source command} {macOnly} { - catch {unset rsrc_foo} - source -rsrcid 128 rsrc.file - list [catch {set rsrc_foo} msg] $msg -} {0 1} -test resource-9.4 {source command} {macOnly} { - catch {unset rsrc_foo} - list [catch {source -rsrcid bad_int rsrc.file} msg] $msg -} {1 {expected integer but got "bad_int"}} -test resource-9.5 {source command} {macOnly} { - catch {unset rsrc_foo} - list [catch {source -rsrcid 100 rsrc.file} msg] $msg -} {1 {The resource "ID=100" could not be loaded from rsrc.file.}} - -# cleanup -catch {file delete rsrc.file} -::tcltest::cleanupTests -return - - - - - - - - - - - - diff --git a/tests/socket.test b/tests/socket.test index 2b382d6..448e7d2 100644 --- a/tests/socket.test +++ b/tests/socket.test @@ -91,7 +91,7 @@ if {![info exists remoteServerPort]} { # set doTestsWithRemoteServer 1 -if {![info exists remoteServerIP] && ($tcl_platform(platform) != "macintosh")} { +if {![info exists remoteServerIP]} { set remoteServerIP 127.0.0.1 } if {($doTestsWithRemoteServer == 1) && (![info exists remoteServerPort])} { @@ -1154,12 +1154,6 @@ test socket-11.5 {remote echo, 50 lines} {socket doTestsWithRemoteServer} { sendCommand {close $socket10_7_test_server} set cnt } 50 -# Macintosh sockets can have more than one server per port -if {$tcl_platform(platform) == "macintosh"} { - set conflictResult {0 2836} -} else { - set conflictResult {1 {couldn't open socket: address already in use}} -} test socket-11.6 {socket conflict} {socket doTestsWithRemoteServer} { set s1 [socket -server accept 2836] if {[catch {set s2 [socket -server accept 2836]} msg]} { @@ -1170,7 +1164,7 @@ test socket-11.6 {socket conflict} {socket doTestsWithRemoteServer} { } close $s1 set result -} $conflictResult +} {1 {couldn't open socket: address already in use}} test socket-11.7 {server with several clients} {socket doTestsWithRemoteServer} { sendCommand { set socket10_9_test_server [socket -server accept 2836] diff --git a/tests/source.test b/tests/source.test index 06d6b51..db12707 100644 --- a/tests/source.test +++ b/tests/source.test @@ -204,110 +204,6 @@ test source-3.5 {return with special code etc.} -setup { invoked from within "source $sourcefile"} {a b c}} - -# Test for the Macintosh specfic features of the source command -test source-4.1 {source error conditions} -constraints macOnly -body { - source -rsrc _no_exist_ -} -result {The resource "_no_exist_" could not be loaded from application.} \ - -returnCodes error - -test source-4.2 {source error conditions} -constraints macOnly -body { - source -rsrcid bad_id -} -returnCodes error -result {expected integer but got "bad_id"} - -test source-4.3 {source error conditions} -constraints macOnly -body { - source -rsrc rsrcName fileName extra -} -returnCodes error -result {wrong # args: should be "source fileName" or "source -rsrc name ?fileName?" or "source -rsrcid id ?fileName?" or "source -encoding name fileName"} - -test source-4.4 {source error conditions} -constraints macOnly -body { - source non_switch rsrcName -} -returnCodes error -result {bad argument: should be "source fileName" or "source -rsrc name ?fileName?" or "source -rsrcid id ?fileName?" or "source -encoding name fileName"} - -test source-4.5 {source error conditions} -constraints macOnly -body { - source -bad_switch argument -} -returnCodes error -result {bad argument: should be "source fileName" or "source -rsrc name ?fileName?" or "source -rsrcid id ?fileName?" or "source -encoding name fileName"} - - -testConstraint testWriteTextResource \ - [llength [info commands testWriteTextResource]] - -test source-5.1 {source resource files} -constraints macOnly -setup { - set sourcefile [makeFile {} bad_file] - removeFile bad_file -} -body { - source -rsrc rsrcName $sourcefile -} -returnCodes error -match glob -result {Error finding the file: "*bad_file".} - -test source-5.2 {source resource files} -constraints macOnly -setup { - set sourcefile [makeFile {return} source.file] -} -body { - source -rsrc rsrcName $sourcefile -} -cleanup { - removeFile source.file -} -returnCodes error -match glob \ - -result {Error reading the file: "*source.file".} - -test source-5.3 {source resource files} -constraints { - macOnly testWriteTextResource -} -setup { - set msg2 unset - set rsrcFile [makeFile {} rsrc.file] - removeFile rsrc.file - testWriteTextResource -rsrc rsrcName -file $rsrc.file {set msg2 ok; return} -} -body { - set result [catch {source -rsrc rsrcName rsrc.file} msg] - list $msg2 $result $msg -} -cleanup { - removeFile rsrc.file -} -result [list ok 0 {}] - -test source-5.4 {source resource files} -constraints { - macOnly testWriteTextResource -} -setup { - set msg2 unset - set rsrsFile [makeFile {} rsrc.file] - removeFile rsrc.file - testWriteTextResource -rsrc fileRsrcName \ - -file $rsrcFile {set msg2 ok; return} -} -body { - source -rsrc fileRsrcName $rsrcFile - set result [catch {source -rsrc fileRsrcName} msg] - list $msg2 $result $msg -} -cleanup { - removeFile rsrc.file -} -result [list ok 1 {The resource "fileRsrcName" could not be loaded from application.}] - -test source-5.5 {source resource files} -constraints { - macOnly testWriteTextResource -} -setup { - set msg2 unset - set rsrcFile [makeFile {} rsrc.file] - removeFile rsrc.file - testWriteTextResource -rsrcid 200 \ - -file $rsrcFile {set msg2 hello; set msg3 bye} -} -body { - set result [catch {source -rsrcid 200 $rsrcFile} msg] - list $msg2 $result $msg -} -cleanup { - removeFile rsrc.file -} -result [list hello 0 bye] - -test source-5.6 {source resource files} -constraints { - macOnly testWriteTextResource -} -setup { - set msg2 unset - set rsrcFile [makeFile {} rsrc.file] - removeFile rsrc.file - testWriteTextResource -rsrcid 200 \ - -file $rsrcFile {set msg2 hello; error bad; set msg3 bye} -} -body { - set result [catch {source -rsrcid 200 rsrc.file} msg] - list $msg2 $result $msg -} -cleanup { - removeFile rsrc.file -} -result [list hello 1 bad] - - test source-6.1 {source is binary ok} -setup { # Note [makeFile] writes in the system encoding. # [source] defaults to reading in the system encoding. diff --git a/unix/Makefile.in b/unix/Makefile.in index 04e8629..72fb215 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -1445,20 +1445,6 @@ BUILD_HTML = \ --srcdir=$(TOP_DIR)/.. $(BUILD_HTML_FLAGS) # -# Target to create a Macintosh version of the distribution. This will -# do a normal distribution and then massage the output to prepare it -# for moving to the Mac platform. This requires a few scripts and -# programs found only in the Tcl group's tool workspace. -# - -macdist: dist machtml - -machtml: - rm -f $(DISTDIR)/mac/tclMacProjects.sea.hqx - rm -rf $(DISTDIR)/doc - $(TCL_EXE) $(TOOL_DIR)/cvtEOL.tcl $(DISTDIR) - -# # Targets to build Solaris package of the distribution for the current # architecture. To build stream packages for both sun4 and i86pc # architectures: diff --git a/unix/README b/unix/README index 72c69fc2..36242da 100644 --- a/unix/README +++ b/unix/README @@ -20,8 +20,7 @@ changes on any UNIX-like system that approximates POSIX, BSD, or System V. We know that it runs on workstations from Sun, H-P, DEC, IBM, and SGI, as well as PCs running Linux, BSDI, and SCO UNIX. To compile for a PC running Windows, see the README file in the directory ../win. To -compile for Max OS X, see the README in the directory ../macosx. To -compile for a classic Macintosh, see the README file in the directory ../mac. +compile for Max OS X, see the README in the directory ../macosx. How To Compile And Install Tcl: ------------------------------- diff --git a/win/tcl.dsp b/win/tcl.dsp index 2d99988..d5e8489 100644 --- a/win/tcl.dsp +++ b/win/tcl.dsp @@ -652,10 +652,6 @@ SOURCE=..\doc\lsort.n # End Source File # Begin Source File -SOURCE=..\doc\Macintosh.3 -# End Source File -# Begin Source File - SOURCE=..\doc\man.macros # End Source File # Begin Source File @@ -780,10 +776,6 @@ SOURCE=..\doc\rename.n # End Source File # Begin Source File -SOURCE=..\doc\resource.n -# End Source File -# Begin Source File - SOURCE=..\doc\return.n # End Source File # Begin Source File -- cgit v0.12 From 7a8cfcd9961d421efa1d708d250e0d981d0e8005 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 16 Nov 2012 08:35:30 +0000 Subject: Don't use deprecated function --- win/tclWinSerial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win/tclWinSerial.c b/win/tclWinSerial.c index 9e9d1af..458b05b 100644 --- a/win/tclWinSerial.c +++ b/win/tclWinSerial.c @@ -376,7 +376,7 @@ SerialGetMilliseconds(void) { Tcl_Time time; - TclpGetTime(&time); + Tcl_GetTime(&time); return (time.sec * 1000 + time.usec / 1000); } -- cgit v0.12 From 1e8c676e12346c0db746226bcf3be0d74db2b967 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 16 Nov 2012 09:38:38 +0000 Subject: Let all test-cases which require Thread, at least require Thread 2.7 --- tests/chanio.test | 2 +- tests/http.test | 2 +- tests/io.test | 2 +- tests/ioCmd.test | 2 +- tests/ioTrans.test | 2 +- tests/socket.test | 2 +- tests/thread.test | 2 +- tests/unixNotfy.test | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/chanio.test b/tests/chanio.test index 9bb11f7..665df50 100644 --- a/tests/chanio.test +++ b/tests/chanio.test @@ -40,7 +40,7 @@ namespace eval ::tcl::test::io { testConstraint testfevent [llength [info commands testfevent]] testConstraint testchannelevent [llength [info commands testchannelevent]] testConstraint testmainthread [llength [info commands testmainthread]] - testConstraint thread [expr {0 == [catch {package require Thread 2.6}]}] + testConstraint thread [expr {0 == [catch {package require Thread 2.7-}]}] # You need a *very* special environment to do some tests. In particular, # many file systems do not support large-files... diff --git a/tests/http.test b/tests/http.test index bde5795..9861e0e 100644 --- a/tests/http.test +++ b/tests/http.test @@ -51,7 +51,7 @@ if {![file exists $httpdFile]} { set removeHttpd 1 } -catch {package require Thread 2.6} +catch {package require Thread 2.7-} if {[catch {package present Thread}] == 0 && [file exists $httpdFile]} { set httpthread [thread::create -preserved] thread::send $httpthread [list source $httpdFile] diff --git a/tests/io.test b/tests/io.test index 9621138..0688c14 100644 --- a/tests/io.test +++ b/tests/io.test @@ -41,7 +41,7 @@ testConstraint fcopy [llength [info commands fcopy]] testConstraint testfevent [llength [info commands testfevent]] testConstraint testchannelevent [llength [info commands testchannelevent]] testConstraint testmainthread [llength [info commands testmainthread]] -testConstraint thread [expr {0 == [catch {package require Thread 2.6}]}] +testConstraint thread [expr {0 == [catch {package require Thread 2.7-}]}] # You need a *very* special environment to do some tests. In # particular, many file systems do not support large-files... diff --git a/tests/ioCmd.test b/tests/ioCmd.test index 5eb0206..03242be 100644 --- a/tests/ioCmd.test +++ b/tests/ioCmd.test @@ -24,7 +24,7 @@ catch [list package require -exact Tcltest [info patchlevel]] # Custom constraints used in this file testConstraint fcopy [llength [info commands fcopy]] testConstraint testchannel [llength [info commands testchannel]] -testConstraint thread [expr {0 == [catch {package require Thread 2.6}]}] +testConstraint thread [expr {0 == [catch {package require Thread 2.7-}]}] #---------------------------------------------------------------------- diff --git a/tests/ioTrans.test b/tests/ioTrans.test index 7027ec1..5a8874c 100644 --- a/tests/ioTrans.test +++ b/tests/ioTrans.test @@ -21,7 +21,7 @@ catch [list package require -exact Tcltest [info patchlevel]] # Custom constraints used in this file testConstraint testchannel [llength [info commands testchannel]] -testConstraint thread [expr {0 == [catch {package require Thread 2.6}]}] +testConstraint thread [expr {0 == [catch {package require Thread 2.7-}]}] # testchannel cut|splice Both needed to test the reflection in threads. # thread::send diff --git a/tests/socket.test b/tests/socket.test index 9f1cc78..5542c09 100644 --- a/tests/socket.test +++ b/tests/socket.test @@ -64,7 +64,7 @@ package require tcltest 2 namespace import -force ::tcltest::* # Some tests require the Thread package or exec command -testConstraint thread [expr {0 == [catch {package require Thread 2.6.6}]}] +testConstraint thread [expr {0 == [catch {package require Thread 2.7-}]}] testConstraint exec [llength [info commands exec]] # Produce a random port number in the Dynamic/Private range diff --git a/tests/thread.test b/tests/thread.test index 43222ac..d79f693 100644 --- a/tests/thread.test +++ b/tests/thread.test @@ -25,7 +25,7 @@ testConstraint testthread [expr {[info commands testthread] != {}}] # Some tests require the Thread package -testConstraint thread [expr {0 == [catch {package require Thread 2.7}]}] +testConstraint thread [expr {0 == [catch {package require Thread 2.7-}]}] # Some tests may not work under valgrind diff --git a/tests/unixNotfy.test b/tests/unixNotfy.test index 0646a3d..2f03529 100644 --- a/tests/unixNotfy.test +++ b/tests/unixNotfy.test @@ -17,7 +17,7 @@ if {[lsearch [namespace children] ::tcltest] == -1} { # When run in a Tk shell, these tests hang. testConstraint noTk [expr {0 != [catch {package present Tk}]}] -testConstraint thread [expr {0 == [catch {package require Thread 2.6}]}] +testConstraint thread [expr {0 == [catch {package require Thread 2.7-}]}] # Darwin always uses a threaded notifier testConstraint unthreaded [expr { ![::tcl::pkgconfig get threaded] -- cgit v0.12 From 7655c307f652206c12c3b5b2b2dd4953c12c5384 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 16 Nov 2012 10:16:18 +0000 Subject: Fix msgcat.test (in case a higher msgcat version is encountered, which is not included with Tcl 8.4)

Doc fix in TCL_MEM_DEBUG.3 --- doc/TCL_MEM_DEBUG.3 | 2 +- tests/msgcat.test | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/TCL_MEM_DEBUG.3 b/doc/TCL_MEM_DEBUG.3 index c531ac6..def44c1 100644 --- a/doc/TCL_MEM_DEBUG.3 +++ b/doc/TCL_MEM_DEBUG.3 @@ -26,7 +26,7 @@ version of \fBTcl_InitMemory\fR to add the \fBmemory\fR command to Tcl. \fBTCL_MEM_DEBUG\fR must be either left defined for all modules or undefined for all modules that are going to be linked together. If they are not, link errors will occur, with either \fBTclDbCkfree\fR and \fBTcl_DbCkalloc\fR or -\fBTcl_Ckalloc\fR and \fBTcl_Ckfree\fR being undefined. +\fBTcl_Alloc\fR and \fBTcl_Free\fR being undefined. .PP Once memory debugging support has been compiled into Tcl, the C functions \fBTcl_ValidateAllMemory\fR, and \fBTcl_DumpActiveMemory\fR, diff --git a/tests/msgcat.test b/tests/msgcat.test index 237a482..3440106 100644 --- a/tests/msgcat.test +++ b/tests/msgcat.test @@ -55,6 +55,13 @@ namespace eval ::msgcat::test { if {[info exists ::tcl::mac::locale]} { set result [string tolower $::tcl::mac::locale] } else { + if {([info sharedlibextension] == ".dll") + && ![catch {package require registry}]} { + # Windows and Cygwin have other ways to determine the + # locale when the environment variables are missing + # and the registry package is present + continue + } set result c } } -- cgit v0.12 From a5e261f15f06a283ad8a648611f1a9eb5b8127e1 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 16 Nov 2012 11:41:45 +0000 Subject: A few unneeded internal CONST/CONST86's --- generic/tclTest.c | 2 +- tools/str2c | 4 ++-- unix/tclXtNotify.c | 11 ++++------- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/generic/tclTest.c b/generic/tclTest.c index 1734968..a8b27fb 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -415,7 +415,7 @@ static int TestInterpResolverCmd(ClientData clientData, #if defined(HAVE_CPUID) || defined(__WIN32__) static int TestcpuidCmd(ClientData dummy, Tcl_Interp* interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); #endif static const Tcl_Filesystem testReportingFilesystem = { diff --git a/tools/str2c b/tools/str2c index 971e552..cff7ba2 100644 --- a/tools/str2c +++ b/tools/str2c @@ -36,7 +36,7 @@ static char data\[\]=\"[translate $r]\";" puts "/* * Multi parts read only string generated by str2c */ -static CONST char * CONST data\[\]= {" +static const char * const data\[\]= {" set n 1 for {set i 0} {$i<$lg} {incr i $MAX} { set part [string range $r $i [expr $i+$MAX-1]] @@ -48,7 +48,7 @@ static CONST char * CONST data\[\]= {" } puts "\tNULL\t/* End of data marker */\n};" puts "\n/* use for instance with: - CONST char * CONST *chunk; + const char * const *chunk; for (chunk=data; *chunk; chunk++) { Tcl_AppendResult(interp, *chunk, (char *) NULL); } diff --git a/unix/tclXtNotify.c b/unix/tclXtNotify.c index 50eb4a2..e289e8c 100644 --- a/unix/tclXtNotify.c +++ b/unix/tclXtNotify.c @@ -16,9 +16,6 @@ #include #include "tclInt.h" -#ifndef CONST86 -# define CONST86 -#endif /* * This structure is used to keep track of the notifier info for a a * registered file. @@ -87,8 +84,8 @@ static void TimerProc(ClientData clientData, XtIntervalId *id); static void CreateFileHandler(int fd, int mask, Tcl_FileProc *proc, ClientData clientData); static void DeleteFileHandler(int fd); -static void SetTimer(CONST86 Tcl_Time * timePtr); -static int WaitForEvent(CONST86 Tcl_Time * timePtr); +static void SetTimer(const Tcl_Time * timePtr); +static int WaitForEvent(const Tcl_Time * timePtr); /* * Functions defined in this file for use by users of the Xt Notifier: @@ -265,7 +262,7 @@ NotifierExitHandler( static void SetTimer( - CONST86 Tcl_Time *timePtr) /* Timeout value, may be NULL. */ + const Tcl_Time *timePtr) /* Timeout value, may be NULL. */ { long timeout; @@ -629,7 +626,7 @@ FileHandlerEventProc( static int WaitForEvent( - CONST86 Tcl_Time *timePtr) /* Maximum block time, or NULL. */ + const Tcl_Time *timePtr) /* Maximum block time, or NULL. */ { int timeout; -- cgit v0.12 From 758a0f5c2e969817509e566bad7546a9d9c66a49 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 16 Nov 2012 15:35:22 +0000 Subject: 3587651 fix [info functions] (Re-implementation in Tcl) --- generic/tclCmdIL.c | 39 +++++++++++++++++++++++++++++++-------- tests/cmdIL.test | 10 ++++++++++ 2 files changed, 41 insertions(+), 8 deletions(-) diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index af7fe60..152e61d 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -1338,19 +1338,42 @@ InfoFunctionsCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - char *pattern; + Tcl_Obj *script; + int code; - if (objc == 1) { - pattern = NULL; - } else if (objc == 2) { - pattern = TclGetString(objv[1]); - } else { + if (objc > 2) { Tcl_WrongNumArgs(interp, 1, objv, "?pattern?"); return TCL_ERROR; } - Tcl_SetObjResult(interp, Tcl_ListMathFuncs(interp, pattern)); - return TCL_OK; + script = Tcl_NewStringObj( +" ::apply [::list {{pattern *}} {\n" +" ::set cmds {}\n" +" ::foreach cmd [::info commands ::tcl::mathfunc::$pattern] {\n" +" ::lappend cmds [::namespace tail $cmd]\n" +" }\n" +" ::foreach cmd [::info commands tcl::mathfunc::$pattern] {\n" +" ::set cmd [::namespace tail $cmd]\n" +" ::if {$cmd ni $cmds} {\n" +" ::lappend cmds $cmd\n" +" }\n" +" }\n" +" ::return $cmds\n" +" } [::namespace current]] ", -1); + + if (objc == 2) { + Tcl_Obj *arg = Tcl_NewListObj(1, &(objv[1])); + + Tcl_AppendObjToObj(script, arg); + Tcl_DecrRefCount(arg); + } + + Tcl_IncrRefCount(script); + code = Tcl_EvalObjEx(interp, script, 0); + + Tcl_DecrRefCount(script); + + return code; } /* diff --git a/tests/cmdIL.test b/tests/cmdIL.test index aed4264..b387e71 100644 --- a/tests/cmdIL.test +++ b/tests/cmdIL.test @@ -769,6 +769,16 @@ test cmdIL-7.8 {lreverse command - shared intrep [Bug 1675044]} -setup { rename K {} } -result 1 +# This belongs in info test, but adding tests there breaks tests +# that compute source file line numbers. +test info-20.6 {Bug 3587651} -setup { + namespace eval my {namespace eval tcl {namespace eval mathfunc { + proc demo x {return 42} + }}}} -body { namespace eval my {expr {"demo" in [info functions]}}} -cleanup { + namespace delete my +} -result 1 + + # cleanup ::tcltest::cleanupTests return -- cgit v0.12 From 10dd9595a33e80ac7ab8ae5ff11b6b6ef3059b20 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 16 Nov 2012 16:11:29 +0000 Subject: 3587651 Fix Tcl_ListMathFuncs() by turning it into a call to [info functions] --- generic/tclBasic.c | 49 ++++++++++++++++++------------------------------- 1 file changed, 18 insertions(+), 31 deletions(-) diff --git a/generic/tclBasic.c b/generic/tclBasic.c index fa13b50..cfb5c43 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -3395,41 +3395,28 @@ Tcl_ListMathFuncs( Tcl_Interp *interp, const char *pattern) { - Namespace *globalNsPtr = (Namespace *) Tcl_GetGlobalNamespace(interp); - Namespace *nsPtr; - Namespace *dummy1NsPtr; - Namespace *dummy2NsPtr; - const char *dummyNamePtr; - Tcl_Obj *result = Tcl_NewObj(); - - TclGetNamespaceForQualName(interp, "::tcl::mathfunc", - globalNsPtr, TCL_FIND_ONLY_NS | TCL_GLOBAL_ONLY, - &nsPtr, &dummy1NsPtr, &dummy2NsPtr, &dummyNamePtr); - if (nsPtr == NULL) { - return result; + Tcl_Obj *script = Tcl_NewStringObj("::info functions ", -1); + Tcl_Obj *result; + Tcl_InterpState state; + + if (pattern) { + Tcl_Obj *patternObj = Tcl_NewStringObj(pattern, -1); + Tcl_Obj *arg = Tcl_NewListObj(1, &patternObj); + + Tcl_AppendObjToObj(script, arg); + Tcl_DecrRefCount(arg); /* Should tear down patternObj too */ } - if ((pattern != NULL) && TclMatchIsTrivial(pattern)) { - if (Tcl_FindHashEntry(&nsPtr->cmdTable, pattern) != NULL) { - Tcl_ListObjAppendElement(NULL, result, - Tcl_NewStringObj(pattern, -1)); - } + state = Tcl_SaveInterpState(interp, TCL_OK); + Tcl_IncrRefCount(script); + if (TCL_OK == Tcl_EvalObjEx(interp, script, 0)) { + result = Tcl_DuplicateObj(Tcl_GetObjResult(interp)); } else { - Tcl_HashSearch cmdHashSearch; - Tcl_HashEntry *cmdHashEntry = - Tcl_FirstHashEntry(&nsPtr->cmdTable,&cmdHashSearch); - - for (; cmdHashEntry != NULL; - cmdHashEntry = Tcl_NextHashEntry(&cmdHashSearch)) { - const char *cmdNamePtr = - Tcl_GetHashKey(&nsPtr->cmdTable, cmdHashEntry); - - if (pattern == NULL || Tcl_StringMatch(cmdNamePtr, pattern)) { - Tcl_ListObjAppendElement(NULL, result, - Tcl_NewStringObj(cmdNamePtr, -1)); - } - } + result = Tcl_NewObj(); } + Tcl_DecrRefCount(script); + Tcl_RestoreInterpState(interp, state); + return result; } -- cgit v0.12 From 094f23c172acca8f32b0888cd536f01fc1daab1b Mon Sep 17 00:00:00 2001 From: dkf Date: Mon, 19 Nov 2012 22:08:35 +0000 Subject: [Bug 3588366]: Corrected implementation of bounds restriction for end-indexed compiled [string range]. Thanks to Emiliano Gavilan for diagnosis and fix. --- ChangeLog | 6 ++++++ generic/tclExecute.c | 3 --- tests/lrange.test | 14 +++++++++++++- tests/stringComp.test | 14 +++++++++++--- 4 files changed, 30 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5c16eaa..70234e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-11-19 Donal K. Fellows + + * generic/tclExecute.c (INST_STR_RANGE_IMM): [Bug 3588366]: Corrected + implementation of bounds restriction for end-indexed compiled [string + range]. Thanks to Emiliano Gavilan for diagnosis and fix. + 2012-11-15 Jan Nijtmans IMPLEMENTATION OF TIP#416 diff --git a/generic/tclExecute.c b/generic/tclExecute.c index cf8f9e7..2b5f713 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -4962,9 +4962,6 @@ TEBCresume( } if (toIdx < -1) { toIdx += 1 + length; - if (toIdx < 0) { - toIdx = 0; - } } else if (toIdx >= length) { toIdx = length - 1; } diff --git a/tests/lrange.test b/tests/lrange.test index 6c81872..17a757e 100644 --- a/tests/lrange.test +++ b/tests/lrange.test @@ -15,7 +15,7 @@ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest namespace import -force ::tcltest::* } - + test lrange-1.1 {range of list elements} { lrange {a b c d} 1 2 } {b c} @@ -61,9 +61,11 @@ test lrange-1.14 {range of list elements} { test lrange-1.15 {range of list elements} { concat \"[lrange {a b \{\ } 0 2]" } {"a b \{\ "} +# emacs highlighting bug workaround --> " test lrange-1.16 {list element quoting} { lrange {[append a .b]} 0 end } {{[append} a .b\]} + test lrange-2.1 {error conditions} { list [catch {lrange a b} msg] $msg } {1 {wrong # args: should be "lrange list first last"}} @@ -83,6 +85,16 @@ test lrange-2.6 {error conditions} { list [catch {lrange "a b c \{ d e" 1 4} msg] $msg } {1 {unmatched open brace in list}} +test lrange-3.1 {Bug 3588366: end-offsets before start} { + apply {l { + lrange $l 0 end-5 + }} {1 2 3 4 5} +} {} + # cleanup ::tcltest::cleanupTests return + +# Local Variables: +# mode: tcl +# End: diff --git a/tests/stringComp.test b/tests/stringComp.test index 56fb69d..9e00ce7 100644 --- a/tests/stringComp.test +++ b/tests/stringComp.test @@ -26,7 +26,7 @@ catch [list package require -exact Tcltest [info patchlevel]] # Some tests require the testobj command testConstraint testobj [expr {[info commands testobj] != {}}] - + test stringComp-1.1 {error conditions} { proc foo {} {string gorp a b} list [catch {foo} msg] $msg @@ -677,7 +677,11 @@ test stringComp-11.54 {string match, failure} { } {0 1 1 1 0 0} ## string range -## not yet bc +test stringComp-12.1 {Bug 3588366: end-offsets before start} { + apply {s { + string range $s 0 end-5 + }} 12345 +} {} ## string repeat ## not yet bc @@ -699,8 +703,12 @@ test stringComp-11.54 {string match, failure} { ## string word* ## not yet bc - + # cleanup catch {rename foo {}} ::tcltest::cleanupTests return + +# Local Variables: +# mode: tcl +# End: -- cgit v0.12