diff options
36 files changed, 409 insertions, 388 deletions
diff --git a/doc/SetErrno.3 b/doc/SetErrno.3 index 3cc0dbc..c202e2e 100644 --- a/doc/SetErrno.3 +++ b/doc/SetErrno.3 @@ -55,7 +55,7 @@ returns a machine-readable textual identifier such as .QW EACCES that corresponds to the current value of \fBerrno\fR. \fBTcl_ErrnoMsg\fR returns a human-readable string such as -.QW "Permission denied" +.QW "permission denied" that corresponds to the value of its \fIerrorCode\fR argument. The \fIerrorCode\fR argument is typically the value returned by \fBTcl_GetErrno\fR. diff --git a/doc/SetVar.3 b/doc/SetVar.3 index eb8333b..d061a2b 100644 --- a/doc/SetVar.3 +++ b/doc/SetVar.3 @@ -250,18 +250,18 @@ and \fBTcl_ObjGetVar2\fR is (if non-NULL) a value with a reference of at least operated upon. .PP The \fInewValuePtr\fR argument to \fBTcl_SetVar2Ex\fR and \fBTcl_ObjSetVar2\fR -may be an arbitrary reference count value; its reference count will be -incremented on success. However, it is recommended to not use a zero reference -count value, as that makes correct handling of the error case tricky. +may be an arbitrary reference count value. Its reference count is +incremented on success. On failure, if is reference count is zero, it is +decremented and freed so the caller need do nothing with it. .PP -The \fIpart1\fR argument to \fBTcl_ObjSetVar2\fR and \fBTcl_ObjGetVar2\fR can -have any reference count; these functions never modify it. It is recommended -to not use a zero reference count for this argument. +The \fIpart1Ptr\fR argument to \fBTcl_ObjSetVar2\fR and \fBTcl_ObjGetVar2\fR can +have any reference count. These functions never modify it. .PP -The \fIpart2\fR argument to \fBTcl_ObjSetVar2\fR and \fBTcl_ObjGetVar2\fR, if +The \fIpart2Ptr\fR argument to \fBTcl_ObjSetVar2\fR and \fBTcl_ObjGetVar2\fR, if non-NULL, should not have a zero reference count as these functions may -retain a reference to it (particularly when it is used to create an array -element that did not previously exist). +retain a reference to it, particularly when it is used to create an array +element that did not previously exist, and decrementing the reference count +later would leave them pointing to a freed Tcl_Obj. .SH "SEE ALSO" Tcl_GetObjResult, Tcl_GetStringResult, Tcl_TraceVar diff --git a/doc/encoding.n b/doc/encoding.n index 8ede974..e02f316 100644 --- a/doc/encoding.n +++ b/doc/encoding.n @@ -96,7 +96,7 @@ Returns a list of the names of encoding profiles. See \fBPROFILES\fR below. Set the system encoding to \fIencoding\fR. If \fIencoding\fR is omitted then the command returns the current system encoding. The system encoding is used whenever Tcl passes strings to system calls. -\" Do not put .VS on whole section as that messes up the bullet list alignment +.\" Do not put .VS on whole section as that messes up the bullet list alignment .SH PROFILES .PP .VS "TCL8.7 TIP656" @@ -172,7 +172,7 @@ These examples use the utility proc below that prints the Unicode code points comprising a Tcl string. .PP .CS -proc codepoints {s} {join [lmap c [split $s ""] { +proc codepoints s {join [lmap c [split $s {}] { string cat U+ [format %.6X [scan $c %c]]}] } .CE @@ -193,8 +193,8 @@ Example 2: Error handling based on profiles: .PP The letter \fBA\fR is Unicode character U+0041 and the byte "\ex80" is invalid in ASCII encoding. -.CS .PP +.CS % codepoints [encoding convertfrom -profile tcl8 ascii A\ex80] U+000041 U+000080 % codepoints [encoding convertfrom -profile replace ascii A\ex80] diff --git a/doc/package.n b/doc/package.n index 820938c..5687480 100644 --- a/doc/package.n +++ b/doc/package.n @@ -286,7 +286,7 @@ then the attempt to set it back to is ineffective and the mode value remains .QW latest . .PP -When passed any other value as an argument, raise an Invalid argument +When passed any other value as an argument, raise an invalid argument error. .PP When an interpreter is created, its initial selection mode value is set to @@ -191,7 +191,7 @@ the file was not found: NOTICE for child interp10 : Created NOTICE for child interp10 : Setting accessPath=(/foo/bar) staticsok=1 nestedok=0 deletehook=() NOTICE for child interp10 : auto_path in interp10 has been set to {$p(:0:)} -ERROR for child interp10 : /foo/bar/init.tcl: No such file or directory +ERROR for child interp10 : /foo/bar/init.tcl: no such file or directory .CE .RE .SS OPTIONS diff --git a/doc/tclvars.n b/doc/tclvars.n index 6e41405..4d1413c 100644 --- a/doc/tclvars.n +++ b/doc/tclvars.n @@ -197,7 +197,7 @@ of the error that occurred, such as \fBENOENT\fR; this will be one of the values defined in the include file errno.h. The \fImsg\fR element will be a human-readable message corresponding to \fIerrName\fR, such as -.QW "No such file or directory" +.QW "no such file or directory" for the \fBENOENT\fR case. .TP \fBTCL\fR ... diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index f2d8904..5c27bbc 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -2201,7 +2201,7 @@ PathSplitCmd( res = Tcl_FSSplitPath(objv[1], (int *)NULL); if (res == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "could not read \"%s\": No such file or directory", + "could not read \"%s\": no such file or directory", TclGetString(objv[1]))); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "PATHSPLIT", "NONESUCH", NULL); diff --git a/generic/tclFCmd.c b/generic/tclFCmd.c index daddbf2..ea8f715 100644 --- a/generic/tclFCmd.c +++ b/generic/tclFCmd.c @@ -1225,8 +1225,8 @@ TclFileLinkCmd( if (errno == EEXIST) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "could not create new link \"%s\": File exists", - TclGetString(objv[index]))); + "could not create new link \"%s\": that path already" + " exists", TclGetString(objv[index]))); Tcl_PosixError(interp); } else if (errno == ENOENT) { /* @@ -1245,7 +1245,7 @@ TclFileLinkCmd( Tcl_DecrRefCount(dirPtr); if (access != 0) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "could not create new link \"%s\": No such file" + "could not create new link \"%s\": no such file" " or directory", TclGetString(objv[index]))); Tcl_PosixError(interp); } else { diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c index aefc84f..02afb55 100644 --- a/generic/tclPathObj.c +++ b/generic/tclPathObj.c @@ -2350,7 +2350,7 @@ SetFsPathFromAny( fsPathPtr = (FsPath *)ckalloc(sizeof(FsPath)); if (transPtr == pathPtr) { - Tcl_GetStringFromObj(pathPtr, NULL); + TclGetString(pathPtr); TclFreeInternalRep(pathPtr); transPtr = Tcl_DuplicateObj(pathPtr); fsPathPtr->filesystemEpoch = 0; diff --git a/generic/tclPosixStr.c b/generic/tclPosixStr.c index 2843998..ad3c26d 100644 --- a/generic/tclPosixStr.c +++ b/generic/tclPosixStr.c @@ -56,9 +56,6 @@ Tcl_ErrnoId(void) #ifdef EAGAIN case EAGAIN: return "EAGAIN"; #endif -#ifdef EALIGN - case EALIGN: return "EALIGN"; -#endif #if defined(EALREADY) && (!defined(EBUSY) || (EALREADY != EBUSY)) case EALREADY: return "EALREADY"; #endif @@ -74,9 +71,6 @@ Tcl_ErrnoId(void) #ifdef EBADMSG case EBADMSG: return "EBADMSG"; #endif -#ifdef ECANCELED - case ECANCELED: return "ECANCELED"; -#endif #ifdef EBADR case EBADR: return "EBADR"; #endif @@ -95,6 +89,12 @@ Tcl_ErrnoId(void) #ifdef EBUSY case EBUSY: return "EBUSY"; #endif +#ifdef ECANCELED + case ECANCELED: return "ECANCELED"; +#endif +#ifdef ECASECLASH + case ECASECLASH: return "ECASECLASH"; +#endif #ifdef ECHILD case ECHILD: return "ECHILD"; #endif @@ -146,6 +146,9 @@ Tcl_ErrnoId(void) #ifdef EFBIG case EFBIG: return "EFBIG"; #endif +#ifdef EFTYPE + case EFTYPE: return "EFTYPE"; +#endif #ifdef EHOSTDOWN case EHOSTDOWN: return "EHOSTDOWN"; #endif @@ -182,9 +185,6 @@ Tcl_ErrnoId(void) #ifdef EISNAME case EISNAM: return "EISNAM"; #endif -#ifdef ELBIN - case ELBIN: return "ELBIN"; -#endif #ifdef EL2HLT case EL2HLT: return "EL2HLT"; #endif @@ -197,6 +197,9 @@ Tcl_ErrnoId(void) #ifdef EL3RST case EL3RST: return "EL3RST"; #endif +#ifdef ELBIN + case ELBIN: return "ELBIN"; +#endif #ifdef ELIBACC case ELIBACC: return "ELIBACC"; #endif @@ -236,9 +239,6 @@ Tcl_ErrnoId(void) #ifdef ENAVAIL case ENAVAIL: return "ENAVAIL"; #endif -#ifdef ENET - case ENET: return "ENET"; -#endif #ifdef ENETDOWN case ENETDOWN: return "ENETDOWN"; #endif @@ -251,6 +251,9 @@ Tcl_ErrnoId(void) #ifdef ENFILE case ENFILE: return "ENFILE"; #endif +#ifdef ENMFILE + case ENMFILE: return "ENMFILE"; +#endif #ifdef ENOANO case ENOANO: return "ENOANO"; #endif @@ -281,6 +284,9 @@ Tcl_ErrnoId(void) #ifdef ENOMEM case ENOMEM: return "ENOMEM"; #endif +#ifdef ENOMEDIUM + case ENOMEDIUM: return "ENOMEDIUM"; +#endif #ifdef ENOMSG case ENOMSG: return "ENOMSG"; #endif @@ -293,6 +299,9 @@ Tcl_ErrnoId(void) #ifdef ENOPROTOOPT case ENOPROTOOPT: return "ENOPROTOOPT"; #endif +#ifdef ENOSHARE + case ENOSHARE: return "ENOSHARE"; +#endif #ifdef ENOSPC case ENOSPC: return "ENOSPC"; #endif @@ -498,441 +507,453 @@ Tcl_ErrnoMsg( { switch (err) { #if defined(E2BIG) && (!defined(EOVERFLOW) || (E2BIG != EOVERFLOW)) - case E2BIG: return "Argument list too long"; + case E2BIG: return "argument list too long"; #endif #ifdef EACCES - case EACCES: return "Permission denied"; + case EACCES: return "permission denied"; #endif #ifdef EADDRINUSE - case EADDRINUSE: return "Address already in use"; + case EADDRINUSE: return "address already in use"; #endif #ifdef EADDRNOTAVAIL - case EADDRNOTAVAIL: return "Cannot assign requested address"; + case EADDRNOTAVAIL: return "cannot assign requested address"; #endif #ifdef EADV - case EADV: return "Advertise error"; + case EADV: return "advertise error"; #endif #ifdef EAFNOSUPPORT - case EAFNOSUPPORT: return "Address family not supported by protocol"; + case EAFNOSUPPORT: return "address family not supported by protocol"; #endif #ifdef EAGAIN - case EAGAIN: return "Resource temporarily unavailable"; -#endif -#ifdef EALIGN - case EALIGN: return "EALIGN"; + case EAGAIN: return "resource temporarily unavailable"; #endif #if defined(EALREADY) && (!defined(EBUSY) || (EALREADY != EBUSY)) - case EALREADY: return "Operation already in progress"; + case EALREADY: return "operation already in progress"; #endif #ifdef EBADE - case EBADE: return "Invalid exchange"; + case EBADE: return "invalid exchange"; #endif #ifdef EBADF - case EBADF: return "Bad file descriptor"; + case EBADF: return "bad file descriptor"; #endif #ifdef EBADFD - case EBADFD: return "File descriptor in bad state"; + case EBADFD: return "file descriptor in bad state"; #endif #ifdef EBADMSG - case EBADMSG: return "Bad message"; + case EBADMSG: return "bad message"; #endif #ifdef EBADR - case EBADR: return "Invalid request descriptor"; + case EBADR: return "invalid request descriptor"; #endif #ifdef EBADRPC case EBADRPC: return "RPC structure is bad"; #endif #ifdef EBADRQC - case EBADRQC: return "Invalid request code"; + case EBADRQC: return "invalid request code"; #endif #ifdef EBADSLT - case EBADSLT: return "Invalid slot"; + case EBADSLT: return "invalid slot"; #endif #ifdef EBFONT - case EBFONT: return "Bad font file format"; + case EBFONT: return "bad font file format"; #endif #ifdef EBUSY - case EBUSY: return "Device or resource busy"; + case EBUSY: return "device or resource busy"; #endif #ifdef ECANCELED - case ECANCELED: return "Operation canceled"; + case ECANCELED: return "operation canceled"; +#endif +#ifdef ECASECLASH + case ECASECLASH: return "filename exists with different case"; #endif #ifdef ECHILD - case ECHILD: return "No child processes"; + case ECHILD: return "no child processes"; #endif #ifdef ECHRNG - case ECHRNG: return "Channel number out of range"; + case ECHRNG: return "channel number out of range"; #endif #ifdef ECOMM - case ECOMM: return "Communication error on send"; + case ECOMM: return "communication error on send"; #endif #ifdef ECONNABORTED - case ECONNABORTED: return "Software caused connection abort"; + case ECONNABORTED: return "software caused connection abort"; #endif #ifdef ECONNREFUSED - case ECONNREFUSED: return "Connection refused"; + case ECONNREFUSED: return "connection refused"; #endif #ifdef ECONNRESET - case ECONNRESET: return "Connection reset by peer"; + case ECONNRESET: return "connection reset by peer"; #endif #if defined(EDEADLK) && (!defined(EWOULDBLOCK) || (EDEADLK != EWOULDBLOCK)) - case EDEADLK: return "Resource deadlock avoided"; + case EDEADLK: return "resource deadlock avoided"; #endif #if defined(EDEADLOCK) && (!defined(EDEADLK) || (EDEADLOCK != EDEADLK)) - case EDEADLOCK: return "Resource deadlock avoided"; + case EDEADLOCK: return "resource deadlock avoided"; #endif #ifdef EDESTADDRREQ - case EDESTADDRREQ: return "Destination address required"; + case EDESTADDRREQ: return "destination address required"; #endif #ifdef EDIRTY - case EDIRTY: return "Mounting a dirty fs w/o force"; + case EDIRTY: return "mounting a dirty fs w/o force"; #endif #ifdef EDOM - case EDOM: return "Numerical argument out of domain"; + case EDOM: return "numerical argument out of domain"; #endif #ifdef EDOTDOT - case EDOTDOT: return "RFS specific error"; + case EDOTDOT: return "cross mount point"; #endif #ifdef EDQUOT - case EDQUOT: return "Disk quota exceeded"; + case EDQUOT: return "disk quota exceeded"; #endif #ifdef EDUPPKG - case EDUPPKG: return "Duplicate package name"; + case EDUPPKG: return "duplicate package name"; #endif #ifdef EEXIST - case EEXIST: return "File exists"; + case EEXIST: return "file exists"; #endif #ifdef EFAULT - case EFAULT: return "Bad address"; + case EFAULT: return "bad address"; #endif #ifdef EFBIG - case EFBIG: return "File too large"; + case EFBIG: return "file too large"; +#endif +#ifdef EFTYPE + case EFTYPE: return "inappropriate file type or format"; #endif #ifdef EHOSTDOWN - case EHOSTDOWN: return "Host is down"; + case EHOSTDOWN: return "host is down"; #endif #ifdef EHOSTUNREACH - case EHOSTUNREACH: return "No route to host"; + case EHOSTUNREACH: return "no route to host"; #endif #if defined(EIDRM) && (!defined(EINPROGRESS) || (EIDRM != EINPROGRESS)) - case EIDRM: return "Identifier removed"; + case EIDRM: return "identifier removed"; #endif #ifdef EINIT - case EINIT: return "Initialization error"; + case EINIT: return "initialization error"; #endif #ifdef EILSEQ - case EILSEQ: return "Invalid or incomplete multibyte or wide character"; + case EILSEQ: return "invalid or incomplete multibyte or wide character"; #endif #ifdef EINPROGRESS - case EINPROGRESS: return "Operation now in progress"; + case EINPROGRESS: return "operation now in progress"; #endif #ifdef EINTR - case EINTR: return "Interrupted system call"; + case EINTR: return "interrupted system call"; #endif #ifdef EINVAL - case EINVAL: return "Invalid argument"; + case EINVAL: return "invalid argument"; #endif #ifdef EIO - case EIO: return "Input/output error"; + case EIO: return "input/output error"; #endif #ifdef EISCONN - case EISCONN: return "Transport endpoint is already connected"; + case EISCONN: return "transport endpoint is already connected"; #endif #ifdef EISDIR - case EISDIR: return "Is a directory"; + case EISDIR: return "is a directory"; #endif #ifdef EISNAME - case EISNAM: return "Is a name file"; -#endif -#ifdef ELBIN - case ELBIN: return "ELBIN"; + case EISNAM: return "is a name file"; #endif #ifdef EL2HLT - case EL2HLT: return "Level 2 halted"; + case EL2HLT: return "level 2 halted"; #endif #ifdef EL2NSYNC - case EL2NSYNC: return "Level 2 not synchronized"; + case EL2NSYNC: return "level 2 not synchronized"; #endif #ifdef EL3HLT - case EL3HLT: return "Level 3 halted"; + case EL3HLT: return "level 3 halted"; #endif #ifdef EL3RST - case EL3RST: return "Level 3 reset"; + case EL3RST: return "level 3 reset"; +#endif +#ifdef ELBIN + case ELBIN: return "inode is remote"; #endif #ifdef ELIBACC - case ELIBACC: return "Can not access a needed shared library"; + case ELIBACC: return "can not access a needed shared library"; #endif #ifdef ELIBBAD - case ELIBBAD: return "Accessing a corrupted shared library"; + case ELIBBAD: return "accessing a corrupted shared library"; #endif #ifdef ELIBEXEC - case ELIBEXEC: return "Cannot exec a shared library directly"; + case ELIBEXEC: return "cannot exec a shared library directly"; #endif #if defined(ELIBMAX) && (!defined(ECANCELED) || (ELIBMAX != ECANCELED)) case ELIBMAX: return - "Attempting to link in too many shared libraries"; + "attempting to link in too many shared libraries"; #endif #ifdef ELIBSCN case ELIBSCN: return ".lib section in a.out corrupted"; #endif #ifdef ELNRNG - case ELNRNG: return "Link number out of range"; + case ELNRNG: return "link number out of range"; #endif #if defined(ELOOP) && (!defined(ENOENT) || (ELOOP != ENOENT)) - case ELOOP: return "Too many levels of symbolic links"; + case ELOOP: return "too many levels of symbolic links"; #endif #ifdef EMFILE - case EMFILE: return "Too many open files"; + case EMFILE: return "too many open files"; #endif #ifdef EMLINK - case EMLINK: return "Too many links"; + case EMLINK: return "too many links"; #endif #ifdef EMSGSIZE - case EMSGSIZE: return "Message too long"; + case EMSGSIZE: return "message too long"; #endif #ifdef EMULTIHOP - case EMULTIHOP: return "Multihop attempted"; + case EMULTIHOP: return "multihop attempted"; #endif #ifdef ENAMETOOLONG - case ENAMETOOLONG: return "File name too long"; + case ENAMETOOLONG: return "file name too long"; #endif #ifdef ENAVAIL - case ENAVAIL: return "Not available"; -#endif -#ifdef ENET - case ENET: return "ENET"; + case ENAVAIL: return "not available"; #endif #ifdef ENETDOWN - case ENETDOWN: return "Network is down"; + case ENETDOWN: return "network is down"; #endif #ifdef ENETRESET - case ENETRESET: return "Network dropped connection on reset"; + case ENETRESET: return "network dropped connection on reset"; #endif #ifdef ENETUNREACH - case ENETUNREACH: return "Network is unreachable"; + case ENETUNREACH: return "network is unreachable"; #endif #ifdef ENFILE - case ENFILE: return "Too many open files in system"; + case ENFILE: return "too many open files in system"; +#endif +#ifdef ENMFILE + case ENMFILE: return "no more files"; #endif #ifdef ENOANO - case ENOANO: return "No anode"; + case ENOANO: return "no anode"; #endif #if defined(ENOBUFS) && (!defined(ENOSR) || (ENOBUFS != ENOSR)) - case ENOBUFS: return "No buffer space available"; + case ENOBUFS: return "no buffer space available"; #endif #ifdef ENOCSI - case ENOCSI: return "No CSI structure available"; + case ENOCSI: return "no CSI structure available"; #endif #if defined(ENODATA) && (!defined(ECONNREFUSED) || (ENODATA != ECONNREFUSED)) - case ENODATA: return "No data available"; + case ENODATA: return "no data available"; #endif #ifdef ENODEV - case ENODEV: return "No such device"; + case ENODEV: return "no such device"; #endif #ifdef ENOENT - case ENOENT: return "No such file or directory"; + case ENOENT: return "no such file or directory"; #endif #ifdef ENOEXEC - case ENOEXEC: return "Exec format error"; + case ENOEXEC: return "exec format error"; #endif #ifdef ENOLCK - case ENOLCK: return "No locks available"; + case ENOLCK: return "no locks available"; #endif #ifdef ENOLINK - case ENOLINK: return "Link has been severed"; + case ENOLINK: return "link has been severed"; #endif #ifdef ENOMEM - case ENOMEM: return "Cannot allocate memory"; + case ENOMEM: return "cannot allocate memory"; +#endif +#ifdef ENOMEDIUM + case ENOMEDIUM: return "no medium"; #endif #ifdef ENOMSG - case ENOMSG: return "No message of desired type"; + case ENOMSG: return "no message of desired type"; #endif #ifdef ENONET - case ENONET: return "Machine is not on the network"; + case ENONET: return "machine is not on the network"; #endif #ifdef ENOPKG - case ENOPKG: return "Package not installed"; + case ENOPKG: return "package not installed"; #endif #ifdef ENOPROTOOPT - case ENOPROTOOPT: return "Protocol not available"; + case ENOPROTOOPT: return "protocol not available"; +#endif +#ifdef ENOSHARE + case ENOSHARE: return "no such host or network path"; #endif #ifdef ENOSPC - case ENOSPC: return "No space left on device"; + case ENOSPC: return "no space left on device"; #endif #if defined(ENOSR) && (!defined(ENAMETOOLONG) || (ENAMETOOLONG != ENOSR)) - case ENOSR: return "Out of streams resources"; + case ENOSR: return "out of streams resources"; #endif #if defined(ENOSTR) && (!defined(ENOTTY) || (ENOTTY != ENOSTR)) - case ENOSTR: return "Device not a stream"; + case ENOSTR: return "device not a stream"; #endif #ifdef ENOSYM - case ENOSYM: return "Unresolved symbol name"; + case ENOSYM: return "unresolved symbol name"; #endif #ifdef ENOSYS - case ENOSYS: return "Function not implemented"; + case ENOSYS: return "function not implemented"; #endif #ifdef ENOTBLK - case ENOTBLK: return "Block device required"; + case ENOTBLK: return "block device required"; #endif #ifdef ENOTCONN - case ENOTCONN: return "Transport endpoint is not connected"; -#endif -#ifdef ENOTRECOVERABLE - case ENOTRECOVERABLE: return "State not recoverable"; + case ENOTCONN: return "transport endpoint is not connected"; #endif #ifdef ENOTDIR - case ENOTDIR: return "Not a directory"; + case ENOTDIR: return "not a directory"; #endif #if defined(ENOTEMPTY) && (!defined(EEXIST) || (ENOTEMPTY != EEXIST)) - case ENOTEMPTY: return "Directory not empty"; + case ENOTEMPTY: return "directory not empty"; #endif #ifdef ENOTNAM - case ENOTNAM: return "Not a name file"; + case ENOTNAM: return "not a name file"; +#endif +#ifdef ENOTRECOVERABLE + case ENOTRECOVERABLE: return "state not recoverable"; #endif #ifdef ENOTSOCK - case ENOTSOCK: return "Socket operation on non-socket"; + case ENOTSOCK: return "socket operation on non-socket"; #endif #ifdef ENOTSUP - case ENOTSUP: return "Operation not supported"; + case ENOTSUP: return "operation not supported"; #endif #ifdef ENOTTY - case ENOTTY: return "Inappropriate ioctl for device"; + case ENOTTY: return "inappropriate ioctl for device"; #endif #ifdef ENOTUNIQ - case ENOTUNIQ: return "Name not unique on network"; + case ENOTUNIQ: return "name not unique on network"; #endif #ifdef ENXIO - case ENXIO: return "No such device or address"; + case ENXIO: return "no such device or address"; #endif #if defined(EOPNOTSUPP) && (!defined(ENOTSUP) || (ENOTSUP != EOPNOTSUPP)) - case EOPNOTSUPP: return "Operation not supported on socket"; + case EOPNOTSUPP: return "operation not supported on socket"; #endif #ifdef EOTHER - case EOTHER: return "Other error"; + case EOTHER: return "other error"; #endif #if defined(EOVERFLOW) && (!defined(EFBIG) || (EOVERFLOW != EFBIG)) && (!defined(EINVAL) || (EOVERFLOW != EINVAL)) - case EOVERFLOW: return "Value too large for defined data type"; + case EOVERFLOW: return "value too large for defined data type"; #endif #ifdef EOWNERDEAD - case EOWNERDEAD: return "Owner died"; + case EOWNERDEAD: return "owner died"; #endif #ifdef EPERM - case EPERM: return "Operation not permitted"; + case EPERM: return "operation not permitted"; #endif #if defined(EPFNOSUPPORT) && (!defined(ENOLCK) || (ENOLCK != EPFNOSUPPORT)) - case EPFNOSUPPORT: return "Protocol family not supported"; + case EPFNOSUPPORT: return "protocol family not supported"; #endif #ifdef EPIPE - case EPIPE: return "Broken pipe"; + case EPIPE: return "broken pipe"; #endif #ifdef EPROCLIM - case EPROCLIM: return "Too many processes"; + case EPROCLIM: return "too many processes"; #endif #ifdef EPROCUNAVAIL - case EPROCUNAVAIL: return "Bad procedure for program"; + case EPROCUNAVAIL: return "bad procedure for program"; #endif #ifdef EPROGMISMATCH - case EPROGMISMATCH: return "Program version wrong"; + case EPROGMISMATCH: return "program version wrong"; #endif #ifdef EPROGUNAVAIL case EPROGUNAVAIL: return "RPC program not available"; #endif #ifdef EPROTO - case EPROTO: return "Protocol error"; + case EPROTO: return "protocol error"; #endif #ifdef EPROTONOSUPPORT - case EPROTONOSUPPORT: return "Protocol not supported"; + case EPROTONOSUPPORT: return "protocol not supported"; #endif #ifdef EPROTOTYPE - case EPROTOTYPE: return "Protocol wrong type for socket"; + case EPROTOTYPE: return "protocol wrong type for socket"; #endif #ifdef ERANGE - case ERANGE: return "Numerical result out of range"; + case ERANGE: return "numerical result out of range"; #endif #if defined(EREFUSED) && (!defined(ECONNREFUSED) || (EREFUSED != ECONNREFUSED)) - case EREFUSED: return "EREFUSED"; + case EREFUSED: return "connection refused"; #endif #ifdef EREMCHG - case EREMCHG: return "Remote address changed"; + case EREMCHG: return "remote address changed"; #endif #ifdef EREMDEV - case EREMDEV: return "Remote device"; + case EREMDEV: return "remote device"; #endif #ifdef EREMOTE - case EREMOTE: return "Object is remote"; + case EREMOTE: return "object is remote"; #endif #ifdef EREMOTEIO - case EREMOTEIO: return "Remote I/O error"; + case EREMOTEIO: return "remote I/O error"; #endif #ifdef EREMOTERELEASE - case EREMOTERELEASE: return "EREMOTERELEASE"; + case EREMOTERELEASE: return "remote peer released connection"; #endif #ifdef EROFS - case EROFS: return "Read-only file system"; + case EROFS: return "read-only file system"; #endif #ifdef ERPCMISMATCH case ERPCMISMATCH: return "RPC version is wrong"; #endif #ifdef ERREMOTE - case ERREMOTE: return "Object is remote"; + case ERREMOTE: return "object is remote"; #endif #ifdef ESHUTDOWN - case ESHUTDOWN: return "Cannot send after transport endpoint shutdown"; + case ESHUTDOWN: return "cannot send after transport endpoint shutdown"; #endif #ifdef ESOCKTNOSUPPORT - case ESOCKTNOSUPPORT: return "Socket type not supported"; + case ESOCKTNOSUPPORT: return "socket type not supported"; #endif #ifdef ESPIPE - case ESPIPE: return "Illegal seek"; + case ESPIPE: return "illegal seek"; #endif #ifdef ESRCH - case ESRCH: return "No such process"; + case ESRCH: return "no such process"; #endif #ifdef ESRMNT - case ESRMNT: return "Srmount error"; + case ESRMNT: return "srmount error"; #endif #ifdef ESTALE - case ESTALE: return "Stale file handle"; + case ESTALE: return "stale file handle"; +#endif +#ifdef ESTRPIPE + case ESTRPIPE: return "streams pipe error"; #endif #ifdef ESUCCESS - case ESUCCESS: return "Success"; + case ESUCCESS: return "success"; #endif #if defined(ETIME) && (!defined(ELOOP) || (ETIME != ELOOP)) - case ETIME: return "Timer expired"; + case ETIME: return "timer expired"; #endif #if defined(ETIMEDOUT) && (!defined(ENOSTR) || (ETIMEDOUT != ENOSTR)) - case ETIMEDOUT: return "Connection timed out"; + case ETIMEDOUT: return "connection timed out"; #endif #ifdef ETOOMANYREFS - case ETOOMANYREFS: return "Too many references: cannot splice"; + case ETOOMANYREFS: return "too many references: cannot splice"; #endif #ifdef ETXTBSY - case ETXTBSY: return "Text file busy"; + case ETXTBSY: return "text file busy"; #endif #ifdef EUCLEAN - case EUCLEAN: return "Structure needs cleaning"; + case EUCLEAN: return "structure needs cleaning"; #endif #ifdef EUNATCH - case EUNATCH: return "Protocol driver not attached"; + case EUNATCH: return "protocol driver not attached"; #endif #ifdef EUSERS - case EUSERS: return "Too many users"; + case EUSERS: return "too many users"; #endif #ifdef EVERSION - case EVERSION: return "Version mismatch"; + case EVERSION: return "version mismatch"; #endif #if defined(EWOULDBLOCK) && (!defined(EAGAIN) || (EWOULDBLOCK != EAGAIN)) - case EWOULDBLOCK: return "Operation would block"; + case EWOULDBLOCK: return "operation would block"; #endif #ifdef EXDEV - case EXDEV: return "Invalid cross-device link"; + case EXDEV: return "invalid cross-device link"; #endif #ifdef EXFULL - case EXFULL: return "Exchange full"; + case EXFULL: return "exchange full"; #endif default: #ifdef NO_STRERROR - return "Unknown POSIX error"; + return "unknown POSIX error"; #else return strerror(err); #endif diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index 014d95e..1b602ea 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -2569,7 +2569,7 @@ ZipAddFile( Tcl_DStringFree(&zpathDs); #ifdef _WIN32 /* hopefully a directory */ - if (strcmp("Permission denied", Tcl_PosixError(interp)) == 0) { + if (strcmp("permission denied", Tcl_PosixError(interp)) == 0) { Tcl_Close(interp, in); return TCL_OK; } diff --git a/library/http/http.tcl b/library/http/http.tcl index d744433..f2ad0a0 100644 --- a/library/http/http.tcl +++ b/library/http/http.tcl @@ -1773,7 +1773,7 @@ proc http::OpenSocket {token DoLater} { set socketPlayCmd($state(socketinfo)) [list ReplayIfClose Wready {} $socketPhQueue($sockOld)] set socketPhQueue($sockOld) {} } - if {[string range $result 0 20] eq {Proxy connect failed:}} { + if {[string range $result 0 20] eq {proxy connect failed:}} { # - The HTTPS proxy did not create a socket. The pre-existing value # (a "placeholder socket") is unchanged. # - The proxy returned a valid HTTP response to the failed CONNECT @@ -1786,7 +1786,7 @@ proc http::OpenSocket {token DoLater} { Finish $token $result # Because socket creation failed, the placeholder "socket" must be # "closed" and (if persistent) removed from the persistent sockets - # table. In the {Proxy connect failed:} case Finish does this because + # table. In the {proxy connect failed:} case Finish does this because # the value of ${token}(connection) is "close". In the other cases here, # it does so because $result is non-empty. } @@ -3392,7 +3392,7 @@ proc http::Connect {token proto phost srvurl} { # If any other requests are in flight or pipelined/queued, they will # be discarded. } - Finish $token "Connect failed: $err" + Finish $token "connect failed: $err" return } @@ -5135,7 +5135,7 @@ proc http::SecureProxyConnect {args} { } } set state(connection) close - set msg "Proxy connect failed: $code" + set msg "proxy connect failed: $code" # - This error message will be detected by http::OpenSocket and will # cause it to present the proxy's HTTP response as that of the # original $token transaction, identified only by state(proxyUsed) diff --git a/library/init.tcl b/library/init.tcl index 22579c2..23f4da3 100644 --- a/library/init.tcl +++ b/library/init.tcl @@ -726,7 +726,7 @@ proc tcl::CopyDirectory {action src dest} { # the following code is now commented out. # # return -code error "error $action \"$src\" to\ - # \"$dest\": File exists" + # \"$dest\": file exists" } else { # Depending on the platform, and on the current # working directory, the directories '.', '..' @@ -738,7 +738,7 @@ proc tcl::CopyDirectory {action src dest} { foreach s $existing { if {[file tail $s] ni {. ..}} { return -code error "error $action \"$src\" to\ - \"$dest\": File exists" + \"$dest\": file exists" } } } diff --git a/library/safe.tcl b/library/safe.tcl index c5546e5..7fc2b5c 100644 --- a/library/safe.tcl +++ b/library/safe.tcl @@ -818,7 +818,7 @@ proc ::safe::CheckFileName {child file} { if {![file exists $file]} { # don't tell the file path - return -code error "No such file or directory" + return -code error "no such file or directory" } if {![file readable $file]} { @@ -908,7 +908,7 @@ proc ::safe::AliasGlob {child args} { } on error msg { Log $child $msg if {$got(-nocomplain)} return - return -code error "Permission denied" + return -code error "permission denied" } if {$got(--)} { set cmd [linsert $cmd end-1 -directory $dir] @@ -921,7 +921,7 @@ proc ::safe::AliasGlob {child args} { # return now and reduce the number of cases to be considered later. Log $child {option -directory must be supplied} if {$got(-nocomplain)} return - return -code error "Permission denied" + return -code error "permission denied" } # Apply the -join semantics ourselves (hence -join not copied to $cmd) @@ -980,7 +980,7 @@ proc ::safe::AliasGlob {child args} { } on error msg { Log $child $msg if {$got(-nocomplain)} continue - return -code error "Permission denied" + return -code error "permission denied" } lappend cmd $opt } @@ -1034,7 +1034,7 @@ proc ::safe::AliasSource {child args} { set at 2 if {$encoding eq "identity"} { Log $child "attempt to use the identity encoding" - return -code error "Permission denied" + return -code error "permission denied" } } else { set at 0 @@ -1052,7 +1052,7 @@ proc ::safe::AliasSource {child args} { set realfile [TranslatePath $child $file] } msg]} { Log $child $msg - return -code error "Permission denied" + return -code error "permission denied" } # check that the path is in the access path of that child @@ -1060,7 +1060,7 @@ proc ::safe::AliasSource {child args} { FileInAccessPath $child $realfile } msg]} { Log $child $msg - return -code error "Permission denied" + return -code error "permission denied" } # Check that the filename exists and is readable. If it is not, deliver @@ -1124,7 +1124,7 @@ proc ::safe::AliasLoad {child file args} { if {!$state(nestedok)} { Log $child "loading to a sub interp (nestedok)\ disabled (trying to load $prefix to $target)" - return -code error "Permission denied (nested load)" + return -code error "permission denied (nested load)" } } @@ -1139,7 +1139,7 @@ proc ::safe::AliasLoad {child file args} { if {!$state(staticsok)} { Log $child "static loading disabled\ (trying to load $prefix to $target)" - return -code error "Permission denied (static library)" + return -code error "permission denied (static library)" } } else { # file loading @@ -1149,7 +1149,7 @@ proc ::safe::AliasLoad {child file args} { set file [TranslatePath $child $file] } on error msg { Log $child $msg - return -code error "Permission denied" + return -code error "permission denied" } # check the translated path @@ -1157,7 +1157,7 @@ proc ::safe::AliasLoad {child file args} { FileInAccessPath $child $file } on error msg { Log $child $msg - return -code error "Permission denied (path)" + return -code error "permission denied (path)" } } diff --git a/tests/chanio.test b/tests/chanio.test index 69a694e..d6a969a 100644 --- a/tests/chanio.test +++ b/tests/chanio.test @@ -2676,8 +2676,8 @@ test chan-io-29.27 {Tcl_Flush on chan closed pipeline} -setup { } else { set x {this was supposed to fail and did not} } - set x -} -match glob -result {1 {error flushing "*": Broken pipe} {POSIX EPIPE {Broken pipe}}} + string tolower $x +} -match glob -result {1 {error flushing "*": broken pipe} {posix epipe {broken pipe}}} test chan-io-29.28 {Tcl_WriteChars, lf mode} -setup { file delete $path(test1) } -body { @@ -4363,7 +4363,7 @@ test chan-io-34.8 {Tcl_Seek on pipes: not supported} -setup { chan seek $pipe 0 current } -returnCodes error -cleanup { chan close $pipe -} -match glob -result {error during seek on "*": Invalid argument} +} -match glob -result {error during seek on "*": invalid argument} test chan-io-34.9 {Tcl_Seek, testing buffered input flushing} -setup { file delete $path(test3) } -body { @@ -5462,11 +5462,11 @@ test chan-io-40.10 {POSIX open access modes: RDONLY} -body { test chan-io-40.11 {POSIX open access modes: RDONLY} -match regexp -body { file delete $path(test3) open $path(test3) RDONLY -} -returnCodes error -result {(?i)couldn't open ".*test3": No such file or directory} +} -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} test chan-io-40.12 {POSIX open access modes: WRONLY} -match regexp -body { file delete $path(test3) open $path(test3) WRONLY -} -returnCodes error -result {(?i)couldn't open ".*test3": No such file or directory} +} -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} test chan-io-40.13 {POSIX open access modes: WRONLY} -body { makeFile xyzzy test3 set f [open $path(test3) WRONLY] @@ -5480,7 +5480,7 @@ test chan-io-40.13 {POSIX open access modes: WRONLY} -body { test chan-io-40.14 {POSIX open access modes: RDWR} -match regexp -body { file delete $path(test3) open $path(test3) RDWR -} -returnCodes error -result {(?i)couldn't open ".*test3": No such file or directory} +} -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} test chan-io-40.15 {POSIX open access modes: RDWR} { makeFile xyzzy test3 set f [open $path(test3) RDWR] @@ -7585,7 +7585,7 @@ test chan-io-60.1 {writing illegal utf sequences} {fileevent testbytestring} { # cut of the remainder of the error stack, especially the filename set result [lreplace $result 3 3 [lindex [split [lindex $result 3] \n] 0]] list $x $result -} {1 {gets {} catch {error writing "stdout": Invalid or incomplete multibyte or wide character}}} +} {1 {gets {} catch {error writing "stdout": invalid or incomplete multibyte or wide character}}} test chan-io-61.1 {Reset eof state after changing the eof char} -setup { set datafile [makeFile {} eofchar] diff --git a/tests/cmdAH.test b/tests/cmdAH.test index a417e34..01a4a36 100644 --- a/tests/cmdAH.test +++ b/tests/cmdAH.test @@ -137,10 +137,10 @@ test cmdAH-2.5 {Tcl_CdObjCmd} -returnCodes error -body { } -result {user "~" doesn't exist} test cmdAH-2.6 {Tcl_CdObjCmd} -returnCodes error -body { cd _foobar -} -result {couldn't change working directory to "_foobar": No such file or directory} +} -result {couldn't change working directory to "_foobar": no such file or directory} test cmdAH-2.6.1 {Tcl_CdObjCmd} -returnCodes error -body { cd "" -} -result {couldn't change working directory to "": No such file or directory} +} -result {couldn't change working directory to "": no such file or directory} test cmdAH-2.6.2 {cd} -constraints {unix nonPortable} -setup { set dir [pwd] } -body { @@ -1459,8 +1459,8 @@ test cmdAH-20.2 {Tcl_FileObjCmd: atime} -setup { [expr {[file atime $gorpfile] == $stat(atime)}] } -result {1 1} test cmdAH-20.3 {Tcl_FileObjCmd: atime} { - list [catch {file atime _bogus_} msg] $msg $errorCode -} {1 {could not read "_bogus_": No such file or directory} {POSIX ENOENT {No such file or directory}}} + list [catch {file atime _bogus_} msg] [string tolower $msg] $errorCode +} {1 {could not read "_bogus_": no such file or directory} {POSIX ENOENT {no such file or directory}}} test cmdAH-20.4 {Tcl_FileObjCmd: atime} -returnCodes error -body { file atime $file notint } -result {expected integer but got "notint"} @@ -1525,7 +1525,7 @@ test cmdAH-22.3 {Tcl_FileObjCmd: isfile} {file isfile $dirfile} 0 catch {file link -symbolic $linkfile $gorpfile} test cmdAH-23.1 {Tcl_FileObjCmd: lstat} -returnCodes error -body { file lstat a -} -result {could not read "a": No such file or directory} +} -result {could not read "a": no such file or directory} test cmdAH-23.2 {Tcl_FileObjCmd: lstat} -returnCodes error -body { file lstat a b c } -result {wrong # args: should be "file lstat name ?varName?"} @@ -1542,9 +1542,9 @@ test cmdAH-23.4 {Tcl_FileObjCmd: lstat} -setup { list $stat(nlink) [expr {$stat(mode) & 0o777}] $stat(type) } -result {1 511 link} test cmdAH-23.5 {Tcl_FileObjCmd: lstat errors} {nonPortable} { - list [catch {file lstat _bogus_ stat} msg] $msg \ + list [catch {file lstat _bogus_ stat} msg] [string tolower $msg] \ $errorCode -} {1 {could not read "_bogus_": No such file or directory} {POSIX ENOENT {No such file or directory}}} +} {1 {could not read "_bogus_": no such file or directory} {POSIX ENOENT {no such file or directory}}} test cmdAH-23.6 {Tcl_FileObjCmd: lstat errors} -setup { unset -nocomplain x } -body { @@ -1634,8 +1634,8 @@ test cmdAH-24.3 {Tcl_FileObjCmd: mtime} -setup { [expr {[file atime $gorpfile] == $stat(atime)}] } -result {1 1} test cmdAH-24.4 {Tcl_FileObjCmd: mtime} { - list [catch {file mtime _bogus_} msg] $msg $errorCode -} {1 {could not read "_bogus_": No such file or directory} {POSIX ENOENT {No such file or directory}}} + list [catch {file mtime _bogus_} msg] [string tolower $msg] $errorCode +} {1 {could not read "_bogus_": no such file or directory} {POSIX ENOENT {no such file or directory}}} test cmdAH-24.5 {Tcl_FileObjCmd: mtime} -setup { # Under Unix, use a file in /tmp to avoid clock skew due to NFS. On other # platforms, just use a file in the local directory. @@ -1814,11 +1814,11 @@ test cmdAH-26.2 {Tcl_FileObjCmd: readlink} {unix nonPortable} { file readlink $linkfile } $gorpfile test cmdAH-26.3 {Tcl_FileObjCmd: readlink errors} {unix nonPortable} { - list [catch {file readlink _bogus_} msg] $msg $errorCode -} {1 {could not readlink "_bogus_": No such file or directory} {POSIX ENOENT {No such file or directory}}} + list [catch {file readlink _bogus_} msg] [string tolower $msg] $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} {win nonPortable} { - list [catch {file readlink _bogus_} msg] $msg $errorCode -} {1 {could not readlink "_bogus_": Invalid argument} {POSIX EINVAL {Invalid argument}}} + list [catch {file readlink _bogus_} msg] [string tolower $msg] $errorCode +} {1 {could not readlink "_bogus_": invalid argument} {POSIX EINVAL {invalid argument}}} # size test cmdAH-27.1 {Tcl_FileObjCmd: size} -returnCodes error -body { @@ -1833,8 +1833,8 @@ test cmdAH-27.2 {Tcl_FileObjCmd: size} { expr {[file size $gorpfile] - $oldsize} } {10} test cmdAH-27.3 {Tcl_FileObjCmd: size} { - list [catch {file size _bogus_} msg] $msg $errorCode -} {1 {could not read "_bogus_": No such file or directory} {POSIX ENOENT {No such file or directory}}} + list [catch {file size _bogus_} msg] [string tolower $msg] $errorCode +} {1 {could not read "_bogus_": no such file or directory} {POSIX ENOENT {no such file or directory}}} test cmdAH-27.4 { Tcl_FileObjCmd: size (built-in Windows names) } -constraints {win} -body { @@ -1884,8 +1884,8 @@ test cmdAH-28.5 {Tcl_FileObjCmd: stat} -constraints {unix notWsl} -setup { format 0o%03o [expr {$stat(mode) & 0o777}] } -result 0o765 test cmdAH-28.6 {Tcl_FileObjCmd: stat} { - list [catch {file stat _bogus_ stat} msg] $msg $errorCode -} {1 {could not read "_bogus_": No such file or directory} {POSIX ENOENT {No such file or directory}}} + list [catch {file stat _bogus_ stat} msg] [string tolower $msg] $errorCode +} {1 {could not read "_bogus_": no such file or directory} {POSIX ENOENT {no such file or directory}}} test cmdAH-28.7 {Tcl_FileObjCmd: stat} -setup { unset -nocomplain x } -returnCodes error -body { @@ -2006,8 +2006,8 @@ test cmdAH-29.4.1 {Tcl_FileObjCmd: type} -constraints {linkDirectory notWine} -s removeDirectory $tempdir } -result link test cmdAH-29.5 {Tcl_FileObjCmd: type} { - list [catch {file type _bogus_} msg] $msg $errorCode -} {1 {could not read "_bogus_": No such file or directory} {POSIX ENOENT {No such file or directory}}} + list [catch {file type _bogus_} msg] [string tolower $msg] $errorCode +} {1 {could not read "_bogus_": no such file or directory} {POSIX ENOENT {no such file or directory}}} test cmdAH-29.6 { Tcl_FileObjCmd: type (built-in Windows names) } -constraints {win} -body { @@ -2206,7 +2206,7 @@ test cmdAH-33.6 {file tempdir: missing parent dir} -setup { file tempdir $base/quux/ } -cleanup { catch {file delete -force $base} -} -result {can't create temporary directory: No such file or directory} +} -result {can't create temporary directory: no such file or directory} test cmdAH-33.7 {file tempdir: missing parent dir} -setup { set base [file join [temporaryDirectory] gorp] file mkdir $base @@ -2214,7 +2214,7 @@ test cmdAH-33.7 {file tempdir: missing parent dir} -setup { file tempdir $base/quux/foobar } -cleanup { catch {file delete -force $base} -} -result {can't create temporary directory: No such file or directory} +} -result {can't create temporary directory: no such file or directory} # This shouldn't work, but just in case a test above failed... catch {close $newFileId} diff --git a/tests/cmdMZ.test b/tests/cmdMZ.test index 27ec3bf..a7aa36c 100644 --- a/tests/cmdMZ.test +++ b/tests/cmdMZ.test @@ -64,7 +64,7 @@ test cmdMZ-1.4 {Tcl_PwdObjCmd: failure} -setup { } -returnCodes error -cleanup { cd $cwd file delete -force $foodir -} -result {error getting working directory name: Permission denied} +} -result {error getting working directory name: permission denied} # The tests for Tcl_RegexpObjCmd, Tcl_RegsubObjCmd are in regexp.test diff --git a/tests/event.test b/tests/event.test index 163a6f9..16cbc24 100644 --- a/tests/event.test +++ b/tests/event.test @@ -184,10 +184,10 @@ test event-5.1 {Tcl_BackgroundError, HandleBgErrors procedures} -setup { } -result {{{a simple error} {a simple error while executing "error "a simple error"" - ("after" script)} NONE} {{couldn't open "non_existent": No such file or directory} {couldn't open "non_existent": No such file or directory + ("after" script)} NONE} {{couldn't open "non_existent": no such file or directory} {couldn't open "non_existent": no such file or directory while executing "open non_existent" - ("after" script)} {POSIX ENOENT {No such file or directory}}}} + ("after" script)} {POSIX ENOENT {no such file or directory}}}} test event-5.2 {Tcl_BackgroundError, HandleBgErrors procedures} -setup { catch {rename bgerror {}} } -body { diff --git a/tests/exec.test b/tests/exec.test index 888042e..d1ef418 100644 --- a/tests/exec.test +++ b/tests/exec.test @@ -333,11 +333,11 @@ test exec-8.2 {long input and output} {exec} { test exec-9.1 {commands returning errors} {exec notValgrind} { set x [catch {exec gorp456} msg] - list $x $msg $errorCode -} {1 {couldn't execute "gorp456": No such file or directory} {POSIX ENOENT {No such file or directory}}} + list $x [string tolower $msg] [string tolower $errorCode] +} {1 {couldn't execute "gorp456": no such file or directory} {posix enoent {no such file or directory}}} test exec-9.2 {commands returning errors} {exec notValgrind} { - list [catch {exec [interpreter] echo foo | foo123} msg] $msg $errorCode -} {1 {couldn't execute "foo123": No such file or directory} {POSIX ENOENT {No such file or directory}}} + string tolower [list [catch {exec [interpreter] echo foo | foo123} msg] $msg $errorCode] +} {1 {couldn't execute "foo123": no such file or directory} {posix enoent {no such file or directory}}} test exec-9.3 {commands returning errors} -constraints {exec stdio} -body { exec [interpreter] $path(sleep) 1 | [interpreter] $path(exit) 43 | [interpreter] $path(sleep) 1 } -returnCodes error -result {child process exited abnormally} @@ -347,7 +347,7 @@ test exec-9.4 {commands returning errors} -constraints {exec stdio} -body { child process exited abnormally} test exec-9.5 {commands returning errors} -constraints {exec stdio notValgrind} -body { exec gorp456 | [interpreter] echo a b c -} -returnCodes error -result {couldn't execute "gorp456": No such file or directory} +} -returnCodes error -result {couldn't execute "gorp456": no such file or directory} test exec-9.6 {commands returning errors} -constraints {exec} -body { exec [interpreter] $path(sh) -c "\"$path(echo)\" error msg 1>&2" } -returnCodes error -result {error msg} @@ -417,13 +417,13 @@ test exec-10.14 {errors in exec invocation} -constraints {exec} -body { } -returnCodes error -result {can't specify "<@" as last word in command} test exec-10.15 {errors in exec invocation} -constraints {exec} -body { exec cat < a/b/c -} -returnCodes error -result {couldn't read file "a/b/c": No such file or directory} +} -returnCodes error -result {couldn't read file "a/b/c": no such file or directory} test exec-10.16 {errors in exec invocation} -constraints {exec} -body { exec cat << foo > a/b/c -} -returnCodes error -result {couldn't write file "a/b/c": No such file or directory} +} -returnCodes error -result {couldn't write file "a/b/c": no such file or directory} test exec-10.17 {errors in exec invocation} -constraints {exec} -body { exec cat << foo > a/b/c -} -returnCodes error -result {couldn't write file "a/b/c": No such file or directory} +} -returnCodes error -result {couldn't write file "a/b/c": no such file or directory} set f [open $path(gorp.file) w] test exec-10.18 {errors in exec invocation} -constraints {exec} -body { exec cat <@ $f @@ -511,16 +511,16 @@ test exec-12.3 {reaping background processes} {exec unix nonPortable} { # Make sure "errorCode" is set correctly. test exec-13.1 {setting errorCode variable} {exec} { - list [catch {exec [interpreter] $path(cat) < a/b/c} msg] $errorCode -} {1 {POSIX ENOENT {No such file or directory}}} + list [catch {exec [interpreter] $path(cat) < a/b/c} msg] [string tolower $errorCode] +} {1 {posix enoent {no such file or directory}}} test exec-13.2 {setting errorCode variable} {exec} { - list [catch {exec [interpreter] $path(cat) > a/b/c} msg] $errorCode -} {1 {POSIX ENOENT {No such file or directory}}} + list [catch {exec [interpreter] $path(cat) > a/b/c} msg] [string tolower $errorCode] +} {1 {posix enoent {no such file or directory}}} test exec-13.3 {setting errorCode variable} {exec notValgrind} { set x [catch {exec _weird_cmd_} msg] - list $x $msg [lindex $errorCode 0] \ - [lrange $errorCode 2 end] -} {1 {couldn't execute "_weird_cmd_": No such file or directory} POSIX {{No such file or directory}}} + list $x [string tolower $msg] [lindex $errorCode 0] \ + [string tolower [lrange $errorCode 2 end]] +} {1 {couldn't execute "_weird_cmd_": no such file or directory} POSIX {{no such file or directory}}} test exec-13.4 {extended exit result codes} -setup { set tmp [makeFile {exit 0x00000101} tmpfile.exec-13.4] } -constraints {win} -body { @@ -556,7 +556,7 @@ test exec-14.3 {unknown switch} -constraints {exec} -body { } -returnCodes error -result {bad option "-gorp": must be -ignorestderr, -keepnewline, or --} test exec-14.4 {-- switch} -constraints {exec notValgrind} -body { exec -- -gorp -} -returnCodes error -result {couldn't execute "-gorp": No such file or directory} +} -returnCodes error -result {couldn't execute "-gorp": no such file or directory} test exec-14.5 {-ignorestderr switch} {exec} { # Alas, the use of -ignorestderr is buried here :-( exec [interpreter] $path(sh2) -c [list $path(echo2) foo bar] 2>@1 diff --git a/tests/fCmd.test b/tests/fCmd.test index 9c4ba21..3476895 100644 --- a/tests/fCmd.test +++ b/tests/fCmd.test @@ -246,7 +246,7 @@ test fCmd-3.4 {FileCopyRename: Tcl_TranslateFileName passes} -setup { cleanup } -constraints {notRoot} -returnCodes error -body { file copy tf1 ~ -} -result {error copying "tf1": No such file or directory} +} -result {error copying "tf1": no such file or directory} test fCmd-3.5 {FileCopyRename: target doesn't exist: stat(target) != 0} -setup { cleanup } -constraints {notRoot} -returnCodes error -body { @@ -321,7 +321,7 @@ test fCmd-3.15 {FileCopyRename: source[0] == '\x00'} -setup { } -constraints {notRoot unixOrWin} -returnCodes error -body { file mkdir td1 file rename / td1 -} -result {error renaming "/" to "td1": File exists} +} -result {error renaming "/" to "td1": file exists} test fCmd-3.16 {FileCopyRename: break on first error} -setup { cleanup } -constraints {notRoot} -returnCodes error -body { @@ -332,7 +332,7 @@ test fCmd-3.16 {FileCopyRename: break on first error} -setup { file mkdir td1 createfile [file join td1 tf3] file rename tf1 tf2 tf3 tf4 td1 -} -result [subst {error renaming "tf3" to "[file join td1 tf3]": File exists}] +} -result [subst {error renaming "tf3" to "[file join td1 tf3]": file exists}] test fCmd-4.1 {TclFileMakeDirsCmd: make each dir: 1 dir} -setup { cleanup @@ -362,7 +362,7 @@ test fCmd-4.5 {TclFileMakeDirsCmd: Tcl_SplitPath returns 0: *name == '\x00'} -se cleanup } -constraints {notRoot} -returnCodes error -body { file mkdir "" -} -result {can't create directory "": No such file or directory} +} -result {can't create directory "": no such file or directory} test fCmd-4.6 {TclFileMakeDirsCmd: one level deep} -setup { cleanup } -constraints {notRoot} -body { @@ -388,7 +388,7 @@ test fCmd-4.9 {TclFileMakeDirsCmd: exists, not dir} -setup { } -constraints {notRoot} -returnCodes error -body { createfile tf1 file mkdir tf1 -} -result [subst {can't create directory "[file join tf1]": File exists}] +} -result [subst {can't create directory "[file join tf1]": file exists}] test fCmd-4.10 {TclFileMakeDirsCmd: exists, is dir} -setup { cleanup } -constraints {notRoot} -body { @@ -406,7 +406,7 @@ test fCmd-4.11 {TclFileMakeDirsCmd: doesn't exist: errno != ENOENT} -setup { } -cleanup { testchmod 0o755 td1/td2 cleanup -} -result {can't create directory "td1/td2/td3": Permission denied} +} -result {can't create directory "td1/td2/td3": permission denied} test fCmd-4.13 {TclFileMakeDirsCmd: doesn't exist: errno == ENOENT} -setup { cleanup } -constraints {notRoot} -body { @@ -423,7 +423,7 @@ test fCmd-4.14 {TclFileMakeDirsCmd: TclpCreateDirectory fails} -setup { file mkdir foo/tf1 } -returnCodes error -cleanup { file delete -force foo -} -result {can't create directory "foo/tf1": Permission denied} +} -result {can't create directory "foo/tf1": permission denied} test fCmd-4.16 {TclFileMakeDirsCmd: TclpCreateDirectory succeeds} -setup { cleanup } -constraints {notRoot} -body { @@ -525,7 +525,7 @@ test fCmd-6.3 {CopyRenameOneFile: lstat(source) != 0} -setup { cleanup } -constraints {notRoot} -returnCodes error -body { file rename tf1 tf2 -} -result {error renaming "tf1": No such file or directory} +} -result {error renaming "tf1": no such file or directory} test fCmd-6.4 {CopyRenameOneFile: lstat(source) == 0} -setup { cleanup } -constraints {notRoot} -body { @@ -549,7 +549,7 @@ test fCmd-6.6 {CopyRenameOneFile: errno != ENOENT} -setup { file rename tf1 td1 } -returnCodes error -cleanup { testchmod 0o755 td1 -} -result {error renaming "tf1" to "td1/tf1": Permission denied} +} -result {error renaming "tf1" to "td1/tf1": permission denied} test fCmd-6.9 {CopyRenameOneFile: errno == ENOENT} -setup { cleanup } -constraints {unix notRoot} -body { @@ -563,14 +563,14 @@ test fCmd-6.10 {CopyRenameOneFile: lstat(target) == 0} -setup { createfile tf1 createfile tf2 file rename tf1 tf2 -} -result {error renaming "tf1" to "tf2": File exists} +} -result {error renaming "tf1" to "tf2": file exists} test fCmd-6.11 {CopyRenameOneFile: force == 0} -setup { cleanup } -constraints {notRoot} -returnCodes error -body { createfile tf1 createfile tf2 file rename tf1 tf2 -} -result {error renaming "tf1" to "tf2": File exists} +} -result {error renaming "tf1" to "tf2": file exists} test fCmd-6.12 {CopyRenameOneFile: force != 0} -setup { cleanup } -constraints {notRoot} -body { @@ -668,7 +668,7 @@ test fCmd-6.23 {CopyRenameOneFile: TclpCopyDirectory failed} -setup { } -returnCodes error -cleanup { file attributes td1 -permissions 0o755 cleanup -} -match regexp -result {^error renaming "td1"( to "/tmp/tcl\d+/td1")?: Permission denied$} +} -match regexp -result {^error renaming "td1"( to "/tmp/tcl\d+/td1")?: permission denied$} test fCmd-6.24 {CopyRenameOneFile: error uses original name} -setup { cleanup } -constraints {unix notRoot} -body { @@ -679,7 +679,7 @@ test fCmd-6.24 {CopyRenameOneFile: error uses original name} -setup { } -returnCodes error -cleanup { file attributes $td1name -permissions 0o755 file delete -force ~/td1 -} -result {error copying "~/td1": Permission denied} +} -result {error copying "~/td1": permission denied} test fCmd-6.25 {CopyRenameOneFile: error uses original name} -setup { cleanup } -constraints {unix notRoot} -body { @@ -691,7 +691,7 @@ test fCmd-6.25 {CopyRenameOneFile: error uses original name} -setup { } -returnCodes error -cleanup { file attributes $td1name -permissions 0o755 file delete -force ~/td1 -} -result {error copying "td2" to "~/td1/td2": Permission denied} +} -result {error copying "td2" to "~/td1/td2": permission denied} test fCmd-6.26 {CopyRenameOneFile: doesn't use original name} -setup { cleanup } -constraints {unix notRoot} -body { @@ -702,7 +702,7 @@ test fCmd-6.26 {CopyRenameOneFile: doesn't use original name} -setup { } -returnCodes error -cleanup { file attributes $td2name -permissions 0o755 file delete -force ~/td1 -} -result "error copying \"~/td1\" to \"td1\": \"[file join $::env(HOME) td1 td2]\": Permission denied" +} -result "error copying \"~/td1\" to \"td1\": \"[file join $::env(HOME) td1 td2]\": permission denied" test fCmd-6.27 {CopyRenameOneFile: TclpCopyDirectory failed} -setup { cleanup $tmpspace } -constraints {notRoot xdev} -returnCodes error -body { @@ -710,7 +710,7 @@ test fCmd-6.27 {CopyRenameOneFile: TclpCopyDirectory failed} -setup { file mkdir [file join $tmpspace td1] createfile [file join $tmpspace td1 tf1] file rename -force td1 $tmpspace -} -match glob -result {error renaming "td1" to "/tmp/tcl*/td1": File exists} +} -match glob -result {error renaming "td1" to "/tmp/tcl*/td1": file exists} test fCmd-6.28 {CopyRenameOneFile: TclpCopyDirectory failed} -setup { cleanup $tmpspace } -constraints {notRoot xdev notWsl} -body { @@ -720,7 +720,7 @@ test fCmd-6.28 {CopyRenameOneFile: TclpCopyDirectory failed} -setup { } -returnCodes error -cleanup { file attributes td1/td2/td3 -permissions 0o755 cleanup $tmpspace -} -match glob -result {error renaming "td1" to "/tmp/tcl*/td1": "td1/td2/td3": Permission denied} +} -match glob -result {error renaming "td1" to "/tmp/tcl*/td1": "td1/td2/td3": permission denied} test fCmd-6.29 {CopyRenameOneFile: TclpCopyDirectory passed} -setup { cleanup $tmpspace } -constraints {notRoot xdev} -body { @@ -738,7 +738,7 @@ test fCmd-6.30 {CopyRenameOneFile: TclpRemoveDirectory failed} -setup { catch {file delete [file join $tmpspace bar]} catch {file attr foo -perm 0o40777} catch {file delete -force foo} -} -match glob -result {*: Permission denied} +} -match glob -result {*: permission denied} test fCmd-6.31 {CopyRenameOneFile: TclpDeleteFile passed} -setup { cleanup $tmpspace } -constraints {notRoot xdev} -body { @@ -751,7 +751,7 @@ test fCmd-6.32 {CopyRenameOneFile: copy} -constraints {notRoot} -setup { cleanup } -returnCodes error -body { file copy tf1 tf2 -} -result {error copying "tf1": No such file or directory} +} -result {error copying "tf1": no such file or directory} test fCmd-7.1 {FileForceOption: none} -constraints {notRoot} -setup { cleanup @@ -793,7 +793,7 @@ test fCmd-8.1 {FileBasename: basename of ~user: argc == 1 && *path == ~} \ file rename ~$user td1 } -returnCodes error -cleanup { file delete -force td1 -} -result "error renaming \"~$user\" to \"td1/[file tail ~$user]\": Permission denied" +} -result "error renaming \"~$user\" to \"td1/[file tail ~$user]\": permission denied" test fCmd-8.2 {FileBasename: basename of ~user: argc == 1 && *path == ~} \ -constraints {unix notRoot} -body { string equal [file tail ~$user] ~$user @@ -801,7 +801,7 @@ test fCmd-8.2 {FileBasename: basename of ~user: argc == 1 && *path == ~} \ test fCmd-8.3 {file copy and path translation: ensure correct error} -body { file copy ~ [file join this file doesnt exist] } -returnCodes error -result [subst \ - {error copying "~" to "[file join this file doesnt exist]": No such file or directory}] + {error copying "~" to "[file join this file doesnt exist]": no such file or directory}] test fCmd-9.1 {file rename: comprehensive: EACCES} -setup { cleanup @@ -813,12 +813,12 @@ test fCmd-9.1 {file rename: comprehensive: EACCES} -setup { } -returnCodes error -cleanup { file delete -force td2 file delete -force td1 -} -result {error renaming "td1" to "td2/td1": Permission denied} +} -result {error renaming "td1" to "td2/td1": permission denied} test fCmd-9.2 {file rename: comprehensive: source doesn't exist} -setup { cleanup } -constraints {notRoot} -returnCodes error -body { file rename tf1 tf2 -} -result {error renaming "tf1": No such file or directory} +} -result {error renaming "tf1": no such file or directory} test fCmd-9.3 {file rename: comprehensive: file to new name} -setup { cleanup } -constraints {notRoot testchmod} -body { @@ -883,7 +883,7 @@ test fCmd-9.7 {file rename: comprehensive: file to existing file} -setup { file rename -force tfs3 tfd3 file rename -force tfs4 tfd4 list [lsort [glob tf*]] $msg [file writable tfd1] [file writable tfd2] [file writable tfd3] [file writable tfd4] -} -result {{tf1 tf2 tfd1 tfd2 tfd3 tfd4} {1 {error renaming "tf1" to "tf2": File exists}} 1 1 0 0} +} -result {{tf1 tf2 tfd1 tfd2 tfd3 tfd4} {1 {error renaming "tf1" to "tf2": file exists}} 1 1 0 0} test fCmd-9.8 {file rename: comprehensive: dir to empty dir} -setup { cleanup } -constraints {notRoot testchmod notNetworkFilesystem} -body { @@ -919,7 +919,7 @@ test fCmd-9.8 {file rename: comprehensive: dir to empty dir} -setup { } list [lsort [glob td*]] $msg [file writable [file join tdd1 tds1]] \ [file writable [file join tdd2 tds2]] $w3 $w4 -} -result [subst {{td1 td2 tdd1 tdd2 tdd3 tdd4} {1 {error renaming "td1" to "[file join td2 td1]": File exists}} 1 1 0 0}] +} -result [subst {{td1 td2 tdd1 tdd2 tdd3 tdd4} {1 {error renaming "td1" to "[file join td2 td1]": file exists}} 1 1 0 0}] # Test can hit EEXIST or EBUSY, depending on underlying filesystem test fCmd-9.9 {file rename: comprehensive: dir to non-empty dir} -setup { cleanup @@ -969,7 +969,7 @@ test fCmd-9.12 {file rename: comprehensive: target exists} -setup { [catch {file rename td1 td2} msg] $msg } -cleanup { testchmod 0o755 [file join td2 td1] -} -result [subst {0 1 1 {error renaming "td1" to "[file join td2 td1]": File exists}}] +} -result [subst {0 1 1 {error renaming "td1" to "[file join td2 td1]": file exists}}] # Test can hit EEXIST or EBUSY, depending on underlying filesystem test fCmd-9.13 {file rename: comprehensive: can't overwrite target} -setup { cleanup @@ -1001,7 +1001,7 @@ test fCmd-9.14.2 {file rename: comprehensive: dir into self} -setup { file rename [file join .. td1] [file join .. td1x] } -returnCodes error -cleanup { cd $dir -} -result [subst {error renaming "[file join .. td1]" to "[file join .. td1x]": Permission denied}] +} -result [subst {error renaming "[file join .. td1]" to "[file join .. td1x]": permission denied}] test fCmd-9.14.3 {file rename: comprehensive: dir into self} -setup { cleanup set dir [pwd] @@ -1033,7 +1033,7 @@ test fCmd-10.1 {file copy: comprehensive: source doesn't exist} -setup { cleanup } -constraints {notRoot} -returnCodes error -body { file copy tf1 tf2 -} -result {error copying "tf1": No such file or directory} +} -result {error copying "tf1": no such file or directory} test fCmd-10.2 {file copy: comprehensive: file to new name} -setup { cleanup } -constraints {notRoot testchmod} -body { @@ -1106,7 +1106,7 @@ test fCmd-10.4 {file copy: comprehensive: file to existing file} -setup { file copy -force tfs3 tfd3 file copy -force tfs4 tfd4 list [lsort [glob tf*]] $msg [file writable tfd1] [file writable tfd2] [file writable tfd3] [file writable tfd4] -} -result {{tf1 tf2 tfd1 tfd2 tfd3 tfd4 tfs1 tfs2 tfs3 tfs4} {1 {error copying "tf1" to "tf2": File exists}} 1 1 0 0} +} -result {{tf1 tf2 tfd1 tfd2 tfd3 tfd4 tfs1 tfs2 tfs3 tfs4} {1 {error copying "tf1" to "tf2": file exists}} 1 1 0 0} test fCmd-10.5 {file copy: comprehensive: dir to empty dir} -setup { cleanup } -constraints {notRoot testchmod} -body { @@ -1130,7 +1130,7 @@ test fCmd-10.5 {file copy: comprehensive: dir to empty dir} -setup { set a4 [catch {file copy -force tds3 tdd3}] set a5 [catch {file copy -force tds4 tdd4}] list [lsort [glob td*]] $a1 $a2 $a3 $a4 $a5 -} -result [subst {{td1 td2 tdd1 tdd2 tdd3 tdd4 tds1 tds2 tds3 tds4} {1 {error copying "td1" to "[file join td2 td1]": File exists}} {1 {error copying "tds1" to "[file join tdd1 tds1]": File exists}} 1 1 1}] +} -result [subst {{td1 td2 tdd1 tdd2 tdd3 tdd4 tds1 tds2 tds3 tds4} {1 {error copying "td1" to "[file join td2 td1]": file exists}} {1 {error copying "tds1" to "[file join tdd1 tds1]": file exists}} 1 1 1}] test fCmd-10.6 {file copy: comprehensive: dir to non-empty dir} -setup { cleanup } -constraints {notRoot unixOrWin testchmod notWsl} -body { @@ -1142,7 +1142,7 @@ test fCmd-10.6 {file copy: comprehensive: dir to non-empty dir} -setup { set a1 [list [catch {file copy -force tds1 tdd1} msg] $msg] set a2 [list [catch {file copy -force tds2 tdd2} msg] $msg] list [lsort [glob td*]] $a1 $a2 [file writable tds1] [file writable tds2] -} -result [subst {{tdd1 tdd2 tds1 tds2} {1 {error copying "tds1" to "[file join tdd1 tds1]": File exists}} {1 {error copying "tds2" to "[file join tdd2 tds2]": File exists}} 1 0}] +} -result [subst {{tdd1 tdd2 tds1 tds2} {1 {error copying "tds1" to "[file join tdd1 tds1]": file exists}} {1 {error copying "tds2" to "[file join tdd2 tds2]": file exists}} 1 0}] test fCmd-10.7 {file rename: comprehensive: file to new name and dir} -setup { cleanup } -constraints {notRoot testchmod} -body { @@ -1199,13 +1199,13 @@ test fCmd-10.11 {file copy: copy to empty file name} -setup { } -returnCodes error -body { createfile tf1 file copy tf1 "" -} -result {error copying "tf1" to "": No such file or directory} +} -result {error copying "tf1" to "": no such file or directory} test fCmd-10.12 {file rename: rename to empty file name} -setup { cleanup } -returnCodes error -body { createfile tf1 file rename tf1 "" -} -result {error renaming "tf1" to "": No such file or directory} +} -result {error renaming "tf1" to "": no such file or directory} cleanup # old tests @@ -2354,21 +2354,21 @@ test fCmd-28.5 {file link: source already exists} -setup { file link abc.dir abc2.dir } -returnCodes error -cleanup { cd [workingDirectory] -} -result {could not create new link "abc.dir": File exists} +} -result {could not create new link "abc.dir": that path already exists} test fCmd-28.6 {file link: unsupported operation} -setup { cd [temporaryDirectory] } -constraints {linkDirectory win} -body { file link -hard abc.link abc.dir } -returnCodes error -cleanup { cd [workingDirectory] -} -result {could not create new link "abc.link" pointing to "abc.dir": Is a directory} +} -result {could not create new link "abc.link" pointing to "abc.dir": is a directory} test fCmd-28.7 {file link: source already exists} -setup { cd [temporaryDirectory] } -constraints {linkFile} -body { file link abc.file abc2.file } -returnCodes error -cleanup { cd [workingDirectory] -} -result {could not create new link "abc.file": File exists} +} -result {could not create new link "abc.file": that path already exists} # In Windows 10 developer mode, we _can_ create symbolic links to files! test fCmd-28.8 {file link} -constraints {linkFile winLessThan10} -setup { cd [temporaryDirectory] @@ -2377,7 +2377,7 @@ test fCmd-28.8 {file link} -constraints {linkFile winLessThan10} -setup { } -cleanup { file delete -force abc.link cd [workingDirectory] -} -returnCodes error -result {could not create new link "abc.link" pointing to "abc.file": Invalid argument} +} -returnCodes error -result {could not create new link "abc.link" pointing to "abc.file": invalid argument} test fCmd-28.9 {file link: success with file} -constraints {linkFile} -setup { cd [temporaryDirectory] file delete -force abc.link @@ -2416,7 +2416,7 @@ test fCmd-28.10.1 {file link: linking to nonexistent path} -setup { file link doesnt/abc.link abc.dir } -returnCodes error -cleanup { cd [workingDirectory] -} -result {could not create new link "doesnt/abc.link": No such file or directory} +} -result {could not create new link "doesnt/abc.link": no such file or directory} test fCmd-28.11 {file link: success with directory} -setup { cd [temporaryDirectory] file delete -force abc.link @@ -2463,7 +2463,7 @@ test fCmd-28.13 {file link} -constraints {linkDirectory notWine} -setup { } -returnCodes error -cleanup { file delete -force abc.link cd [workingDirectory] -} -result {could not create new link "abc.link": File exists} +} -result {could not create new link "abc.link": that path already exists} test fCmd-28.14 {file link: deletes link not dir} -setup { cd [temporaryDirectory] } -constraints {linkDirectory} -body { diff --git a/tests/fileName.test b/tests/fileName.test index d16f86e..09662ff 100644 --- a/tests/fileName.test +++ b/tests/fileName.test @@ -1332,8 +1332,8 @@ unset globname catch {file attributes globTest/a1 -permissions 0} test filename-15.1 {unix specific globbing} {unix nonPortable} { - list [catch {glob globTest/a1/*} msg] $msg $errorCode -} {1 {couldn't read directory "globtest/a1": Permission denied} {POSIX EACCES {Permission denied}}} + string tolower [list [catch {glob globTest/a1/*} msg] $msg $errorCode] +} {1 {couldn't read directory "globtest/a1": permission denied} {posix eacces {permission denied}}} test filename-15.2 {unix specific no complain: no errors} {unix nonPortable} { glob -nocomplain globTest/a1/* } {} diff --git a/tests/fileSystem.test b/tests/fileSystem.test index 40746be..003bf40 100644 --- a/tests/fileSystem.test +++ b/tests/fileSystem.test @@ -498,19 +498,19 @@ test filesystem-5.1 {cache and ~} -constraints testfilesystem -setup { test filesystem-6.1 {empty file name} -returnCodes error -body { open "" -} -result {couldn't open "": No such file or directory} +} -result {couldn't open "": no such file or directory} test filesystem-6.2 {empty file name} -returnCodes error -body { file stat "" arr -} -result {could not read "": No such file or directory} +} -result {could not read "": no such file or directory} test filesystem-6.3 {empty file name} -returnCodes error -body { file atime "" -} -result {could not read "": No such file or directory} +} -result {could not read "": no such file or directory} test filesystem-6.4 {empty file name} -returnCodes error -body { file attributes "" -} -result {could not read "": No such file or directory} +} -result {could not read "": no such file or directory} test filesystem-6.5 {empty file name} -returnCodes error -body { file copy "" "" -} -result {error copying "": No such file or directory} +} -result {error copying "": no such file or directory} test filesystem-6.6 {empty file name} {file delete ""} {} test filesystem-6.7 {empty file name} {file dirname ""} . test filesystem-6.8 {empty file name} {file executable ""} 0 @@ -521,19 +521,19 @@ test filesystem-6.12 {empty file name} {file isfile ""} 0 test filesystem-6.13 {empty file name} {file join ""} {} test filesystem-6.14 {empty file name} -returnCodes error -body { file link "" -} -result {could not read link "": No such file or directory} +} -result {could not read link "": no such file or directory} test filesystem-6.15 {empty file name} -returnCodes error -body { file lstat "" arr -} -result {could not read "": No such file or directory} +} -result {could not read "": no such file or directory} test filesystem-6.16 {empty file name} -returnCodes error -body { file mtime "" -} -result {could not read "": No such file or directory} +} -result {could not read "": no such file or directory} test filesystem-6.17 {empty file name} -returnCodes error -body { file mtime "" 0 -} -result {could not read "": No such file or directory} +} -result {could not read "": no such file or directory} test filesystem-6.18 {empty file name} -returnCodes error -body { file mkdir "" -} -result {can't create directory "": No such file or directory} +} -result {can't create directory "": no such file or directory} test filesystem-6.19 {empty file name} {file nativename ""} {} test filesystem-6.20 {empty file name} {file normalize ""} {} test filesystem-6.21 {empty file name} {file owned ""} 0 @@ -541,17 +541,17 @@ test filesystem-6.22 {empty file name} {file pathtype ""} relative test filesystem-6.23 {empty file name} {file readable ""} 0 test filesystem-6.24 {empty file name} -returnCodes error -body { file readlink "" -} -result {could not read link "": No such file or directory} +} -result {could not read link "": no such file or directory} test filesystem-6.25 {empty file name} -returnCodes error -body { file rename "" "" -} -result {error renaming "": No such file or directory} +} -result {error renaming "": no such file or directory} test filesystem-6.26 {empty file name} {file rootname ""} {} test filesystem-6.27 {empty file name} -returnCodes error -body { file separator "" } -result {unrecognised path} test filesystem-6.28 {empty file name} -returnCodes error -body { file size "" -} -result {could not read "": No such file or directory} +} -result {could not read "": no such file or directory} test filesystem-6.29 {empty file name} {file split ""} {} test filesystem-6.30 {empty file name} -returnCodes error -body { file system "" @@ -559,7 +559,7 @@ test filesystem-6.30 {empty file name} -returnCodes error -body { test filesystem-6.31 {empty file name} {file tail ""} {} test filesystem-6.32 {empty file name} -returnCodes error -body { file type "" -} -result {could not read "": No such file or directory} +} -result {could not read "": no such file or directory} test filesystem-6.33 {empty file name} {file writable ""} 0 test filesystem-6.34 {file name with (invalid) nul character} { list [catch "open foo\x00" msg] $msg @@ -692,7 +692,7 @@ test filesystem-7.4 {cross-filesystem file copy with -force} -setup { file delete -force simplefile file delete -force file2 cd $dir -} -result {0 {} 1 {error copying "simplefs:/simplefile" to "file2": File exists} 0 {} 1} +} -result {0 {} 1 {error copying "simplefs:/simplefile" to "file2": file exists} 0 {} 1} test filesystem-7.5 {cross-filesystem file copy with -force} -setup { set dir [pwd] cd [tcltest::temporaryDirectory] @@ -717,7 +717,7 @@ test filesystem-7.5 {cross-filesystem file copy with -force} -setup { file delete -force simplefile file delete -force file2 cd $dir -} -result {0 {} 1 {error copying "simplefs:/simplefile" to "file2": File exists} 0 {} 1} +} -result {0 {} 1 {error copying "simplefs:/simplefile" to "file2": file exists} 0 {} 1} test filesystem-7.6 {cross-filesystem dir copy with -force} -setup { set dir [pwd] cd [tcltest::temporaryDirectory] @@ -745,7 +745,7 @@ test filesystem-7.6 {cross-filesystem dir copy with -force} -setup { file delete -force simpledir file delete -force dir2 cd $dir -} -result {0 {} 1 {error copying "simplefs:/simpledir" to "dir2/simpledir": File exists} 0 {} 1 1} +} -result {0 {} 1 {error copying "simplefs:/simpledir" to "dir2/simpledir": file exists} 0 {} 1 1} test filesystem-7.7 {cross-filesystem dir copy with -force} -setup { set dir [pwd] cd [tcltest::temporaryDirectory] @@ -775,7 +775,7 @@ test filesystem-7.7 {cross-filesystem dir copy with -force} -setup { file delete -force simpledir file delete -force dir2 cd $dir -} -result {0 {} 1 {error copying "simplefs:/simpledir" to "dir2/simpledir": File exists} 0 {} 1 1} +} -result {0 {} 1 {error copying "simplefs:/simpledir" to "dir2/simpledir": file exists} 0 {} 1 1} removeFile gorp.file test filesystem-7.8 {vfs cd} -setup { set dir [pwd] diff --git a/tests/http.test b/tests/http.test index 6e973d0..e9a0b31 100644 --- a/tests/http.test +++ b/tests/http.test @@ -630,7 +630,7 @@ test http-4.14.$ThreadLevel {http::Event} -body { lindex [http::error $token] 0 } -cleanup { catch {http::cleanup $token} -} -result {Connect failed: Connection refused} +} -result {connect failed: connection refused} # Bogus host test http-4.15.$ThreadLevel {http::Event} -body { diff --git a/tests/io.test b/tests/io.test index ea0f7a2..7c80f9b 100644 --- a/tests/io.test +++ b/tests/io.test @@ -2855,8 +2855,8 @@ test io-29.27 {Tcl_Flush on closed pipeline} stdio { } } regsub {".*":} $x {"":} x - set x -} {1 {error flushing "": Broken pipe} {POSIX EPIPE {Broken pipe}}} + string tolower $x +} {1 {error flushing "": broken pipe} {posix epipe {broken pipe}}} test io-29.28 {Tcl_WriteChars, lf mode} { file delete $path(test1) set f [open $path(test1) w] @@ -4753,8 +4753,8 @@ test io-34.8 {Tcl_Seek on pipes: not supported} stdio { set x [list [catch {seek $f1 0 current} msg] $msg] close $f1 regsub {".*":} $x {"":} x - set x -} {1 {error during seek on "": Invalid argument}} + string tolower $x +} {1 {error during seek on "": invalid argument}} test io-34.9 {Tcl_Seek, testing buffered input flushing} { file delete $path(test3) set f [open $path(test3) w] @@ -5931,11 +5931,11 @@ test io-40.10 {POSIX open access modes: RDONLY} { test io-40.11 {POSIX open access modes: RDONLY} -match regexp -body { file delete $path(test3) open $path(test3) RDONLY -} -returnCodes error -result {(?i)couldn't open ".*test3": No such file or directory} +} -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} test io-40.12 {POSIX open access modes: WRONLY} -match regexp -body { file delete $path(test3) open $path(test3) WRONLY -} -returnCodes error -result {(?i)couldn't open ".*test3": No such file or directory} +} -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} test io-40.13 {POSIX open access modes: WRONLY} { makeFile xyzzy test3 set f [open $path(test3) WRONLY] @@ -5951,7 +5951,7 @@ test io-40.13 {POSIX open access modes: WRONLY} { test io-40.14 {POSIX open access modes: RDWR} -match regexp -body { file delete $path(test3) open $path(test3) RDWR -} -returnCodes error -result {(?i)couldn't open ".*test3": No such file or directory} +} -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} test io-40.15 {POSIX open access modes: RDWR} { makeFile xyzzy test3 set f [open $path(test3) RDWR] @@ -7638,7 +7638,7 @@ test io-52.20 {TclCopyChannel & encodings} -setup { } -cleanup { close $in close $out -} -returnCodes 1 -match glob -result {error reading "file*": Invalid or incomplete multibyte or wide character} +} -returnCodes 1 -match glob -result {error reading "file*": invalid or incomplete multibyte or wide character} test io-52.21 {TclCopyChannel & encodings} -setup { set out [open $path(utf8-fcopy.txt) w] fconfigure $out -encoding utf-8 -translation lf @@ -7659,7 +7659,7 @@ test io-52.21 {TclCopyChannel & encodings} -setup { } -cleanup { close $in close $out -} -returnCodes 1 -match glob -result {error writing "file*": Invalid or incomplete multibyte or wide character} +} -returnCodes 1 -match glob -result {error writing "file*": invalid or incomplete multibyte or wide character} test io-52.22 {TclCopyChannel & encodings} -setup { set out [open $path(utf8-fcopy.txt) w] fconfigure $out -encoding utf-8 -translation lf @@ -7686,7 +7686,7 @@ test io-52.22 {TclCopyChannel & encodings} -setup { close $in close $out unset ::s0 -} -match glob -result {0 {error reading "file*": Invalid or incomplete multibyte or wide character}} +} -match glob -result {0 {error reading "file*": invalid or incomplete multibyte or wide character}} test io-52.23 {TclCopyChannel & encodings} -setup { set out [open $path(utf8-fcopy.txt) w] fconfigure $out -encoding utf-8 -translation lf @@ -7713,7 +7713,7 @@ test io-52.23 {TclCopyChannel & encodings} -setup { close $in close $out unset ::s0 -} -match glob -result {0 {error writing "file*": Invalid or incomplete multibyte or wide character}} +} -match glob -result {0 {error writing "file*": invalid or incomplete multibyte or wide character}} test io-53.1 {CopyData} {fcopy} { @@ -8696,7 +8696,7 @@ test io-60.1 {writing illegal utf sequences} {fileevent testbytestring} { # cut of the remainder of the error stack, especially the filename set result [lreplace $result 3 3 [lindex [split [lindex $result 3] \n] 0]] list $x $result -} {1 {gets ABC catch {error writing "stdout": Invalid or incomplete multibyte or wide character}}} +} {1 {gets ABC catch {error writing "stdout": invalid or incomplete multibyte or wide character}}} test io-61.1 {Reset eof state after changing the eof char} -setup { set datafile [makeFile {} eofchar] @@ -9166,7 +9166,7 @@ test io-75.6 {invalid utf-8 encoding gets is not ignored (-profile strict)} -set } -cleanup { close $f removeFile io-75.6 -} -match glob -returnCodes 1 -result {error reading "*": Invalid or incomplete multibyte or wide character} +} -match glob -returnCodes 1 -result {error reading "*": invalid or incomplete multibyte or wide character} test io-75.7 {invalid utf-8 encoding gets is not ignored (-profile strict)} -setup { set fn [makeFile {} io-75.7] @@ -9182,7 +9182,7 @@ test io-75.7 {invalid utf-8 encoding gets is not ignored (-profile strict)} -set } -cleanup { close $f removeFile io-75.7 -} -match glob -returnCodes 1 -result {error reading "*": Invalid or incomplete multibyte or wide character} +} -match glob -returnCodes 1 -result {error reading "*": invalid or incomplete multibyte or wide character} test io-75.8 {invalid utf-8 encoding eof handling (-profile strict)} -setup { set fn [makeFile {} io-75.8] @@ -9216,7 +9216,7 @@ test io-75.9 {unrepresentable character write passes and is replaced by ?} -setu } -cleanup { close $f removeFile io-75.9 -} -match glob -result [list {A} {error writing "*": Invalid or incomplete multibyte or wide character}] +} -match glob -result [list {A} {error writing "*": invalid or incomplete multibyte or wide character}] # Incomplete sequence test. # This error may IMHO only be detected with the close. @@ -9260,7 +9260,7 @@ test io-75.11 {shiftjis encoding error read results in raw bytes} -setup { } -cleanup { close $f removeFile io-75.11 -} -match glob -result {41 1 {error reading "*": Invalid or incomplete multibyte or wide character}} +} -match glob -result {41 1 {error reading "*": invalid or incomplete multibyte or wide character}} test io-75.12 {invalid utf-8 encoding read is ignored} -setup { set fn [makeFile {} io-75.12] @@ -9295,7 +9295,7 @@ test io-75.13 {invalid utf-8 encoding read is not ignored (-profile strict)} -se } -cleanup { close $f removeFile io-75.13 -} -match glob -result {41 1 {error reading "*": Invalid or incomplete multibyte or wide character}} +} -match glob -result {41 1 {error reading "*": invalid or incomplete multibyte or wide character}} # ### ### ### ######### ######### ######### diff --git a/tests/ioCmd.test b/tests/ioCmd.test index 483781e..61b3bdd 100644 --- a/tests/ioCmd.test +++ b/tests/ioCmd.test @@ -439,7 +439,7 @@ test iocmd-11.3 {I/O to command pipelines} {unixOrWin unixExecs} { } {1 {can't read output from command: standard output was redirected} {TCL OPERATION EXEC BADREDIRECT}} test iocmd-11.4 {I/O to command pipelines} {notValgrind unixOrWin} { list [catch {open "| no_such_command_exists" rb} msg] $msg $::errorCode -} {1 {couldn't execute "no_such_command_exists": No such file or directory} {POSIX ENOENT {No such file or directory}}} +} {1 {couldn't execute "no_such_command_exists": no such file or directory} {POSIX ENOENT {no such file or directory}}} test iocmd-12.1 {POSIX open access modes: RDONLY} { file delete $path(test1) @@ -456,11 +456,11 @@ test iocmd-12.1 {POSIX open access modes: RDONLY} { test iocmd-12.2 {POSIX open access modes: RDONLY} -match regexp -body { file delete $path(test3) open $path(test3) RDONLY -} -returnCodes error -result {(?i)couldn't open ".*test3": No such file or directory} +} -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} test iocmd-12.3 {POSIX open access modes: WRONLY} -match regexp -body { file delete $path(test3) open $path(test3) WRONLY -} -returnCodes error -result {(?i)couldn't open ".*test3": No such file or directory} +} -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} # # Test 13.4 relies on assigning the same channel name twice. # @@ -486,7 +486,7 @@ test iocmd-12.4 {POSIX open access modes: WRONLY} {unix} { test iocmd-12.5 {POSIX open access modes: RDWR} -match regexp -body { file delete $path(test3) open $path(test3) RDWR -} -returnCodes error -result {(?i)couldn't open ".*test3": No such file or directory} +} -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} test iocmd-12.6 {POSIX open access modes: errors} { concat [catch {open $path(test3) "FOO \{BAR BAZ"} msg] $msg\n$::errorInfo } "1 unmatched open brace in list @@ -545,8 +545,8 @@ test iocmd-13.5 {errors in open command} { test iocmd-13.6 {errors in open command} { set msg [list [catch {open _non_existent_} msg] $msg $::errorCode] regsub [file join {} _non_existent_] $msg "_non_existent_" msg - set msg -} {1 {couldn't open "_non_existent_": No such file or directory} {POSIX ENOENT {No such file or directory}}} + string tolower $msg +} {1 {couldn't open "_non_existent_": no such file or directory} {posix enoent {no such file or directory}}} test iocmd-13.7 {errors in open command} { list [catch {open $path(test1) b} msg] $msg } {1 {illegal access mode "b"}} @@ -884,7 +884,7 @@ test iocmd-21.22 {[close] in [read] segfaults} -setup { } -returnCodes error -cleanup { catch {close $ch} rename foo {} -} -match glob -result {*Invalid argument*} +} -match glob -result {*invalid argument*} test iocmd-21.23 {[close] in [gets] segfaults} -setup { proc foo {method chan args} { switch -- $method initialize { @@ -1743,7 +1743,7 @@ test iocmd-28.10 {chan seek, not supported by handler} -match glob -body { close $c rename foo {} set res -} -result {1 {error during seek on "rc*": Invalid argument}} +} -result {1 {error during seek on "rc*": invalid argument}} test iocmd-28.11 {chan seek, error return} -match glob -body { set res {} proc foo {args} {oninit seek; onfinal; track; return -code error BOOM!} @@ -3433,7 +3433,7 @@ test iocmd.tf-28.10 {chan seek, not supported by handler} -match glob -body { } c] rename foo {} set res -} -result {1 {error during seek on "rc*": Invalid argument}} \ +} -result {1 {error during seek on "rc*": invalid argument}} \ -constraints {testchannel thread} test iocmd.tf-28.11 {chan seek, error return} -match glob -body { set res {} diff --git a/tests/load.test b/tests/load.test index 32b1c3b..005c451 100644 --- a/tests/load.test +++ b/tests/load.test @@ -96,13 +96,13 @@ test load-3.1 {error in _Init procedure, same interpreter} \ [list $dll $loaded] { list [catch {load [file join $testDir pkge$ext] pkge} msg] \ $msg $::errorInfo $::errorCode -} {1 {couldn't open "non_existent": No such file or directory} {couldn't open "non_existent": No such file or directory +} {1 {couldn't open "non_existent": no such file or directory} {couldn't open "non_existent": no such file or directory while executing "open non_existent" invoked from within "if 44 {open non_existent}" invoked from within -"load [file join $testDir pkge$ext] pkge"} {POSIX ENOENT {No such file or directory}}} +"load [file join $testDir pkge$ext] pkge"} {POSIX ENOENT {no such file or directory}}} test load-3.2 {error in _Init procedure, child interpreter} \ [list $dll $loaded] { catch {interp delete x} @@ -113,13 +113,13 @@ test load-3.2 {error in _Init procedure, child interpreter} \ $msg $::errorInfo $::errorCode] interp delete x set result -} {1 {couldn't open "non_existent": No such file or directory} {couldn't open "non_existent": No such file or directory +} {1 {couldn't open "non_existent": no such file or directory} {couldn't open "non_existent": no such file or directory while executing "open non_existent" invoked from within "if 44 {open non_existent}" invoked from within -"load [file join $testDir pkge$ext] pkge x"} {POSIX ENOENT {No such file or directory}}} +"load [file join $testDir pkge$ext] pkge x"} {POSIX ENOENT {no such file or directory}}} test load-4.1 {reloading package into same interpreter} [list $dll $loaded] { list [catch {load [file join $testDir pkga$ext] pkga} msg] $msg diff --git a/tests/macOSXFCmd.test b/tests/macOSXFCmd.test index dc0eca0..5a62a2a 100644 --- a/tests/macOSXFCmd.test +++ b/tests/macOSXFCmd.test @@ -34,7 +34,7 @@ if {[testConstraint unix] && $tcl_platform(os) eq "Darwin"} { test macOSXFCmd-1.1 {MacOSXGetFileAttribute - file not found} {macosxFileAttr notRoot} { catch {file delete -force -- foo.test} list [catch {file attributes foo.test -creator} msg] $msg -} {1 {could not read "foo.test": No such file or directory}} +} {1 {could not read "foo.test": no such file or directory}} test macOSXFCmd-1.2 {MacOSXGetFileAttribute - creator} {macosxFileAttr notRoot} { catch {file delete -force -- foo.test} close [open foo.test w] @@ -63,7 +63,7 @@ test macOSXFCmd-1.5 {MacOSXGetFileAttribute - rsrclength} {macosxFileAttr notRoo test macOSXFCmd-2.1 {MacOSXSetFileAttribute - file not found} {macosxFileAttr notRoot} { catch {file delete -force -- foo.test} list [catch {file attributes foo.test -creator FOOC} msg] $msg -} {1 {could not read "foo.test": No such file or directory}} +} {1 {could not read "foo.test": no such file or directory}} test macOSXFCmd-2.2 {MacOSXSetFileAttribute - creator} {macosxFileAttr notRoot} { catch {file delete -force -- foo.test} close [open foo.test w] diff --git a/tests/result.test b/tests/result.test index 3a86930..5ae29b2 100644 --- a/tests/result.test +++ b/tests/result.test @@ -62,7 +62,7 @@ test result-2.1 {Tcl_RestoreInterpResult} {testsaveresult} { test result-3.1 {Tcl_DiscardInterpResult} -constraints testsaveresult -body { testsaveresult append {cd _foobar} 1 -} -returnCodes error -result {couldn't change working directory to "_foobar": No such file or directory} +} -returnCodes error -result {couldn't change working directory to "_foobar": no such file or directory} test result-3.2 {Tcl_DiscardInterpResult} {testsaveresult} { testsaveresult free {set x 42} 1 } {42} diff --git a/tests/safe-stock.test b/tests/safe-stock.test index f79db4f..d23d86e 100644 --- a/tests/safe-stock.test +++ b/tests/safe-stock.test @@ -45,7 +45,7 @@ foreach i [interp children] { if {[string match *zipfs:/* [info library]]} { # pkgIndex.tcl is in [info library] # file to be sourced is in [info library]/opt* - set pkgOptErrMsg {Permission denied} + set pkgOptErrMsg {permission denied} } else { # pkgIndex.tcl and file to be sourced are # both in [info library]/opt* diff --git a/tests/safe.test b/tests/safe.test index 8efed54..f3890b7 100644 --- a/tests/safe.test +++ b/tests/safe.test @@ -549,7 +549,7 @@ test safe-8.3 {safe source control on file} -setup { safe::interpDelete $i rename safe-test-log {} unset i log -} -result {1 {Permission denied} {{ERROR for child a : ".": is a directory}}} +} -result {1 {permission denied} {{ERROR for child a : ".": is a directory}}} test safe-8.4 {safe source control on file} -setup { set i "a" catch {safe::interpDelete $i} @@ -565,7 +565,7 @@ test safe-8.4 {safe source control on file} -setup { safe::interpDelete $i rename safe-test-log {} unset i log -} -result {1 {Permission denied} {{ERROR for child a : "/abc/def": not in access_path}}} +} -result {1 {permission denied} {{ERROR for child a : "/abc/def": not in access_path}}} test safe-8.5 {safe source control on file} -setup { set i "a" catch {safe::interpDelete $i} @@ -585,7 +585,7 @@ test safe-8.5 {safe source control on file} -setup { safe::interpDelete $i rename safe-test-log {} unset i log -} -result [list 1 {No such file or directory} [list "ERROR for child a : [file join [info library] blah]:No such file or directory"]] +} -result [list 1 {no such file or directory} [list "ERROR for child a : [file join [info library] blah]:no such file or directory"]] test safe-8.6 {safe source control on file} -setup { set i "a" catch {safe::interpDelete $i} @@ -603,7 +603,7 @@ test safe-8.6 {safe source control on file} -setup { safe::interpDelete $i rename safe-test-log {} unset i log -} -result [list 1 {No such file or directory} [list "ERROR for child a : [file join [info library] blah.tcl]:No such file or directory"]] +} -result [list 1 {no such file or directory} [list "ERROR for child a : [file join [info library] blah.tcl]:no such file or directory"]] test safe-8.7 {safe source control on file} -setup { set i "a" catch {safe::interpDelete $i} @@ -623,7 +623,7 @@ test safe-8.7 {safe source control on file} -setup { safe::interpDelete $i rename safe-test-log {} unset i log -} -result [list 1 {No such file or directory} [list "ERROR for child a : [file join [info library] xxxxxxxxxxx.tcl]:No such file or directory"]] +} -result [list 1 {no such file or directory} [list "ERROR for child a : [file join [info library] xxxxxxxxxxx.tcl]:no such file or directory"]] test safe-8.8 {safe source forbids -rsrc} emptyTest { # Disabled this test. It was only useful for long unsupported # Mac OS 9 systems. [Bug 860a9f1945] @@ -1389,14 +1389,14 @@ test safe-10.2 {testing statics loading / -nostatics} -constraints tcl::test -bo interp eval $i {load {} Safepfx1} } -returnCodes error -cleanup { safe::interpDelete $i -} -result {Permission denied (static library)} +} -result {permission denied (static library)} test safe-10.3 {testing nested statics loading / no nested by default} -setup { set i [safe::interpCreate] } -constraints tcl::test -body { interp eval $i {interp create x; load {} Safepfx1 x} } -returnCodes error -cleanup { safe::interpDelete $i -} -result {Permission denied (nested load)} +} -result {permission denied (nested load)} test safe-10.4 {testing nested statics loading / -nestedloadok} -constraints tcl::test -body { set i [safe::interpCreate -nestedloadok] interp eval $i {interp create x; load {} Safepfx1 x} @@ -1521,21 +1521,21 @@ test safe-12.1 {glob is restricted [Bug 2906841]} -setup { $i eval glob ../* } -returnCodes error -cleanup { safe::interpDelete $i -} -result "Permission denied" +} -result "permission denied" test safe-12.2 {glob is restricted [Bug 2906841]} -setup { set i [safe::interpCreate] } -body { $i eval glob -directory .. * } -returnCodes error -cleanup { safe::interpDelete $i -} -result "Permission denied" +} -result "permission denied" test safe-12.3 {glob is restricted [Bug 2906841]} -setup { set i [safe::interpCreate] } -body { $i eval glob -join .. * } -returnCodes error -cleanup { safe::interpDelete $i -} -result "Permission denied" +} -result "permission denied" test safe-12.4 {glob is restricted [Bug 2906841]} -setup { set i [safe::interpCreate] } -body { @@ -1563,7 +1563,7 @@ test safe-12.7 {glob is restricted} -setup { $i eval glob * } -returnCodes error -cleanup { safe::interpDelete $i -} -result {Permission denied} +} -result {permission denied} ### 13. More tests for Safe base glob, with patches @ Bug 2964715 ### More tests of glob in sections 12, 16. @@ -1590,7 +1590,7 @@ test safe-13.1 {glob is restricted [Bug 2964715]} -setup { $i eval glob * } -returnCodes error -cleanup { safe::interpDelete $i -} -result {Permission denied} +} -result {permission denied} test safe-13.2 {mimic the valid glob call by ::tcl::tm::UnknownHandler [Bug 2964715]} -setup { set i [safe::interpCreate] buildEnvironment deleteme.tm @@ -1614,7 +1614,7 @@ test safe-13.3 {cf 13.2 but test glob failure when -directory is outside access } -returnCodes error -cleanup { safe::interpDelete $i removeDirectory $testdir -} -result {Permission denied} +} -result {permission denied} test safe-13.4 {another valid glob call [Bug 2964715]} -setup { set i [safe::interpCreate] buildEnvironment deleteme.tm @@ -1642,7 +1642,7 @@ test safe-13.5 {as 13.4 but test glob failure when -directory is outside access } -returnCodes error -cleanup { safe::interpDelete $i removeDirectory $testdir -} -result {Permission denied} +} -result {permission denied} test safe-13.6 {as 13.4 but test silent failure when result is outside access_path [Bug 2964715]} -setup { set i [safe::interpCreate] buildEnvironment deleteme.tm diff --git a/tests/socket.test b/tests/socket.test index 2509bc0..052733f 100644 --- a/tests/socket.test +++ b/tests/socket.test @@ -645,7 +645,7 @@ test socket_$af-2.9 {socket conflict} -constraints [list socket supported_$af st close $f } -returnCodes error -cleanup { close $s -} -match glob -result {couldn't open socket: Address already in use*} +} -match glob -result {couldn't open socket: address already in use*} test socket_$af-2.10 {close on accept, accepted socket lives} -setup { set done 0 set timer [after 20000 "set done timed_out"] @@ -802,7 +802,7 @@ test socket_$af-3.1 {socket conflict} -constraints [list socket supported_$af st } -cleanup { puts $f bye close $f -} -returnCodes error -result {couldn't open socket: Address already in use} +} -returnCodes error -result {couldn't open socket: address already in use} test socket_$af-3.2 {server with several clients} -setup { file delete $path(script) set f [open $path(script) w] @@ -1397,7 +1397,7 @@ test socket_$af-11.6 {socket conflict} -setup { list [getPort $s2] [close $s2] } -cleanup { close $s1 -} -returnCodes error -result {couldn't open socket: Address already in use} +} -returnCodes error -result {couldn't open socket: address already in use} test socket_$af-11.7 {server with several clients} -setup { set port [sendCommand { set server [socket -server accept 0] @@ -2041,7 +2041,7 @@ test socket-14.1 {[socket -async] fileevent while still connecting} \ close $client unset x } -result {{} ok} -test socket-14.2 {[socket -async] fileevent Connection refused} \ +test socket-14.2 {[socket -async] fileevent connection refused} \ -constraints {socket} \ -body { set client [socket -async localhost [randport]] @@ -2054,7 +2054,7 @@ test socket-14.2 {[socket -async] fileevent Connection refused} \ after cancel $after close $client unset x after client - } -result {ok {Connection refused}} + } -result {ok {connection refused}} test socket-14.3 {[socket -async] when server only listens on IPv6} \ -constraints {socket supported_inet6 localhost_v6} \ -setup { @@ -2113,7 +2113,7 @@ test socket-14.5 {[socket -async] which fails before any connect() can be made} socket -async -myaddr 192.0.2.42 127.0.0.1 [randport] } \ -returnCodes 1 \ - -result {couldn't open socket: Cannot assign requested address} + -result {couldn't open socket: cannot assign requested address} test socket-14.6.0 {[socket -async] with no event loop and server listening on IPv4} \ -constraints {socket supported_inet localhost_v4} \ -setup { @@ -2226,7 +2226,7 @@ test socket-14.7.2 {pending [socket -async] and blocking [gets], no listener} \ list $x [fconfigure $sock -error] [fconfigure $sock -error] } -cleanup { close $sock - } -match glob -result {{error reading "sock*": Transport endpoint is not connected} {Connection refused} {}} + } -match glob -result {{error reading "sock*": transport endpoint is not connected} {connection refused} {}} test socket-14.8.0 {pending [socket -async] and nonblocking [gets], server is IPv4} \ -constraints {socket supported_inet localhost_v4} \ -setup { @@ -2291,7 +2291,7 @@ test socket-14.8.2 {pending [socket -async] and nonblocking [gets], no listener} list $x [fconfigure $sock -error] [fconfigure $sock -error] } -cleanup { close $sock - } -match glob -result {{error reading "sock*": Transport endpoint is not connected} {Connection refused} {}} + } -match glob -result {{error reading "sock*": transport endpoint is not connected} {connection refused} {}} test socket-14.9.0 {pending [socket -async] and blocking [puts], server is IPv4} \ -constraints {socket supported_inet localhost_v4} \ -setup { @@ -2406,7 +2406,7 @@ test socket-14.11.0 {pending [socket -async] and nonblocking [puts], no listener } -cleanup { catch {close $sock} unset x - } -result {Transport endpoint is not connected} -returnCodes 1 + } -result {transport endpoint is not connected} -returnCodes 1 test socket-14.11.1 {pending [socket -async] and nonblocking [puts], no listener, flush} \ -constraints {socket testsocket_testflags} \ -body { @@ -2425,7 +2425,7 @@ test socket-14.11.1 {pending [socket -async] and nonblocking [puts], no listener } -cleanup { catch {close $sock} catch {unset x} - } -result {Transport endpoint is not connected} -returnCodes 1 + } -result {transport endpoint is not connected} -returnCodes 1 test socket-14.12 {[socket -async] background progress triggered by [fconfigure -error]} \ -constraints {socket} \ -body { @@ -2439,7 +2439,7 @@ test socket-14.12 {[socket -async] background progress triggered by [fconfigure } -cleanup { close $s unset x s - } -result {Connection refused} + } -result {connection refused} test socket-14.13 {testing writable event when quick failure} \ -constraints {socket win supported_inet notWine} \ @@ -2543,7 +2543,7 @@ set num 0 set x {localhost {socket} 127.0.0.1 {supported_inet} ::1 {supported_inet6}} set resultok {-result "sock*" -match glob} set resulterr { - -result {couldn't open socket: Connection refused} + -result {couldn't open socket: connection refused} -returnCodes 1 } foreach {servip sc} $x { diff --git a/tests/source.test b/tests/source.test index 59a9d1a..f5f9f0f 100644 --- a/tests/source.test +++ b/tests/source.test @@ -104,8 +104,8 @@ test source-2.6 {source error conditions} -setup { removeFile _non_existent_ } -body { source $sourcefile -} -match glob -result {couldn't read file "*_non_existent_": No such file or directory} \ - -errorCode {POSIX ENOENT {No such file or directory}} +} -match glob -result {couldn't read file "*_non_existent_": no such file or directory} \ + -errorCode {POSIX ENOENT {no such file or directory}} test source-2.7 {utf-8 with BOM} -setup { set sourcefile [makeFile {} source.file] } -body { diff --git a/tests/unixFCmd.test b/tests/unixFCmd.test index 4f5d8f4..1250c0b 100644 --- a/tests/unixFCmd.test +++ b/tests/unixFCmd.test @@ -103,7 +103,7 @@ test unixFCmd-1.1 {TclpRenameFile: EACCES} -setup { } -returnCodes error -cleanup { file attributes td1/td2 -permissions 0o755 cleanup -} -result {error renaming "td1/td2/td3": Permission denied} +} -result {error renaming "td1/td2/td3": permission denied} test unixFCmd-1.2 {TclpRenameFile: EEXIST} -setup { cleanup } -constraints {unix notRoot} -body { @@ -112,7 +112,7 @@ test unixFCmd-1.2 {TclpRenameFile: EEXIST} -setup { file rename td2 td1 } -returnCodes error -cleanup { cleanup -} -result {error renaming "td2" to "td1/td2": File exists} +} -result {error renaming "td2" to "td1/td2": file exists} test unixFCmd-1.3 {TclpRenameFile: EINVAL} -setup { cleanup } -constraints {unix notRoot} -body { @@ -131,7 +131,7 @@ test unixFCmd-1.5 {TclpRenameFile: ENOENT} -setup { file rename td2 td1 } -returnCodes error -cleanup { cleanup -} -result {error renaming "td2": No such file or directory} +} -result {error renaming "td2": no such file or directory} test unixFCmd-1.6 {TclpRenameFile: ENOTDIR} {emptyTest unix notRoot} { # can't make it happen } {} @@ -145,7 +145,7 @@ test unixFCmd-1.7 {TclpRenameFile: EXDEV} -setup { catch {file delete /tmp/bar} catch {file attr foo -perm 0o40777} catch {file delete -force foo} -} -match glob -result {*: Permission denied} +} -match glob -result {*: permission denied} test unixFCmd-1.8 {Checking EINTR Bug} {unix notRoot nonPortable} { testalarm after 2000 @@ -261,7 +261,7 @@ test unixFCmd-12.1 {GetGroupAttribute - file not found} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot} -returnCodes error -body { file attributes foo.test -group -} -result {could not read "foo.test": No such file or directory} +} -result {could not read "foo.test": no such file or directory} test unixFCmd-12.2 {GetGroupAttribute - file found} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot} -body { @@ -275,7 +275,7 @@ test unixFCmd-13.1 {GetOwnerAttribute - file not found} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot} -returnCodes error -body { file attributes foo.test -group -} -result {could not read "foo.test": No such file or directory} +} -result {could not read "foo.test": no such file or directory} test unixFCmd-13.2 {GetOwnerAttribute} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot} -body { @@ -289,7 +289,7 @@ test unixFCmd-14.1 {GetPermissionsAttribute - file not found} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot} -returnCodes error -body { file attributes foo.test -permissions -} -result {could not read "foo.test": No such file or directory} +} -result {could not read "foo.test": no such file or directory} test unixFCmd-14.2 {GetPermissionsAttribute} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot} -body { @@ -311,7 +311,7 @@ test unixFCmd-15.2 {SetGroupAttribute - invalid file} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot foundGroup} -returnCodes error -body { file attributes foo.test -group $group -} -result {could not set group for file "foo.test": No such file or directory} +} -result {could not set group for file "foo.test": no such file or directory} #changing owners hard to do test unixFCmd-16.1 {SetOwnerAttribute - current owner} -setup { @@ -327,7 +327,7 @@ test unixFCmd-16.2 {SetOwnerAttribute - invalid file} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot} -returnCodes error -body { file attributes foo.test -owner $user -} -result {could not set owner for file "foo.test": No such file or directory} +} -result {could not set owner for file "foo.test": no such file or directory} test unixFCmd-16.3 {SetOwnerAttribute - invalid owner} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot} -returnCodes error -body { @@ -347,7 +347,7 @@ test unixFCmd-17.2 {SetPermissionsAttribute} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot} -returnCodes error -body { file attributes foo.test -permissions 0 -} -result {could not set permissions for file "foo.test": No such file or directory} +} -result {could not set permissions for file "foo.test": no such file or directory} test unixFCmd-17.3 {SetPermissionsAttribute} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot} -body { @@ -404,7 +404,7 @@ test unixFCmd-19.1 {GetReadOnlyAttribute - file not found} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot readonlyAttr} -returnCodes error -body { file attributes foo.test -readonly -} -result {could not read "foo.test": No such file or directory} +} -result {could not read "foo.test": no such file or directory} test unixFCmd-19.2 {GetReadOnlyAttribute} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot readonlyAttr} -body { @@ -430,7 +430,7 @@ test unixFCmd-20.2 {SetReadOnlyAttribute} -setup { catch {file delete -force -- foo.test} } -constraints {unix notRoot readonlyAttr} -returnCodes error -body { file attributes foo.test -readonly 1 -} -result {could not read "foo.test": No such file or directory} +} -result {could not read "foo.test": no such file or directory} # cleanup cleanup diff --git a/tests/winFCmd.test b/tests/winFCmd.test index 6848f21..3be1920 100644 --- a/tests/winFCmd.test +++ b/tests/winFCmd.test @@ -946,12 +946,12 @@ test winFCmd-10.1 {AttributesPosixError - get} -constraints {win} -setup { cleanup } -body { file attributes td1 -archive -} -returnCodes error -result {could not read "td1": No such file or directory} +} -returnCodes error -result {could not read "td1": no such file or directory} test winFCmd-10.2 {AttributesPosixError - set} -constraints {win} -setup { cleanup } -body { file attributes td1 -archive 0 -} -returnCodes error -result {could not read "td1": No such file or directory} +} -returnCodes error -result {could not read "td1": no such file or directory} test winFCmd-11.1 {GetWinFileAttributes} -constraints {win} -setup { cleanup @@ -1098,7 +1098,7 @@ test winFCmd-15.1 {SetWinFileAttributes} -constraints {win} -setup { cleanup } -body { file attributes td1 -archive 0 -} -returnCodes error -result {could not read "td1": No such file or directory} +} -returnCodes error -result {could not read "td1": no such file or directory} test winFCmd-15.2 {SetWinFileAttributes - archive} -constraints {win} -setup { cleanup } -body { @@ -1268,11 +1268,11 @@ test winFCmd-17.1 {Windows bad permissions cd} -constraints win -body { regsub ".*: " $err "" err set err } else { - set err "Permission denied" + set err "permission denied" } } -cleanup { cd $pwd -} -result "Permission denied" +} -result "permission denied" cd $pwd unset d dd pwd diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index 5cd6b7db..7396258 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -380,7 +380,7 @@ TclpInitPlatform(void) } /* - * The code below causes SIGPIPE (Broken pipe) errors to be ignored. This + * The code below causes SIGPIPE (broken pipe) errors to be ignored. This * is needed so that Tcl processes don't die if they create child * processes (e.g. using "exec" or "open") that terminate prematurely. * The signal handler is only set up when the first interpreter is diff --git a/win/tclWinFCmd.c b/win/tclWinFCmd.c index 19411e8..7f8cfd1 100644 --- a/win/tclWinFCmd.c +++ b/win/tclWinFCmd.c @@ -1603,7 +1603,7 @@ ConvertFileNameFormat( if (splitPath == NULL || pathc == 0) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "could not read \"%s\": No such file or directory", + "could not read \"%s\": no such file or directory", Tcl_GetString(fileName))); errno = ENOENT; Tcl_PosixError(interp); |