summaryrefslogtreecommitdiffstats
path: root/tests/unixInit.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2003-11-05 20:50:44 (GMT)
committerdgp <dgp@users.sourceforge.net>2003-11-05 20:50:44 (GMT)
commitbb75623bfdb7105dcd6f60e0363d4597213cd139 (patch)
treef1d6d8d06b9e8f2a23e8c0f392213aa03f455035 /tests/unixInit.test
parent9f0235b154c23e8eefeb9005acb58abe0c2415f4 (diff)
downloadtcl-bb75623bfdb7105dcd6f60e0363d4597213cd139.zip
tcl-bb75623bfdb7105dcd6f60e0363d4597213cd139.tar.gz
tcl-bb75623bfdb7105dcd6f60e0363d4597213cd139.tar.bz2
* tests/unixInit.test (unixInit-2.10): New test to expose [Bug 832657]
failure of TclpInitLibraryPath() to properly handle .. in the path of the executable.
Diffstat (limited to 'tests/unixInit.test')
-rw-r--r--tests/unixInit.test36
1 files changed, 35 insertions, 1 deletions
diff --git a/tests/unixInit.test b/tests/unixInit.test
index 0f01943..4ec31a5 100644
--- a/tests/unixInit.test
+++ b/tests/unixInit.test
@@ -10,7 +10,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: unixInit.test,v 1.30 2002/12/04 07:07:40 hobbs Exp $
+# RCS: @(#) $Id: unixInit.test,v 1.31 2003/11/05 20:50:44 dgp Exp $
package require tcltest 2
namespace import -force ::tcltest::*
@@ -266,6 +266,40 @@ test unixInit-2.9 {TclpInitLibraryPath: paths relative to executable} {unix noSp
set x
} [list /tmp/lib/tcl[info tclversion] /lib/tcl[info tclversion] \
/tmp/library /library /tcl[info patchlevel]/library]
+
+test unixInit-2.10 {TclpInitLibraryPath: executable relative} -constraints {
+ unixOnly stdio
+} -setup {
+ set tmpDir [makeDirectory tmp]
+ set sparklyDir [makeDirectory sparkly $tmpDir]
+ set execPath [file join [makeDirectory bin $sparklyDir] tcltest]
+ file copy [interpreter] $execPath
+ set libDir [makeDirectory lib $sparklyDir]
+ set scriptDir [makeDirectory tcl[info tclversion] $libDir]
+ makeFile {} init.tcl $scriptDir
+ set saveDir [pwd]
+ cd $libDir
+} -body {
+ # Checking for Bug 832657
+ lrange [getlibpath [file join .. bin tcltest]] 2 3
+} -cleanup {
+ cd $saveDir
+ unset saveDir
+ removeFile init.tcl $scriptDir
+ unset scriptDir
+ removeDirectory tcl[info tclversion] $libDir
+ unset libDir
+ file delete $execPath
+ unset execPath
+ removeDirectory bin $sparklyDir
+ removeDirectory lib $sparklyDir
+ unset sparklyDir
+ removeDirectory sparkly $tmpDir
+ unset tmpDir
+ removeDirectory tmp
+} -result [list [file join [temporaryDirectory] tmp sparkly library] \
+ [file join [temporaryDirectory] tmp library] ]
+
test unixInit-3.1 {TclpSetInitialEncodings} -constraints {
unixOnly stdio
} -body {