diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/encoding.test | 15 | ||||
-rw-r--r-- | tests/unixInit.test | 81 |
2 files changed, 38 insertions, 58 deletions
diff --git a/tests/encoding.test b/tests/encoding.test index 897bebf..b62b604 100644 --- a/tests/encoding.test +++ b/tests/encoding.test @@ -8,7 +8,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: encoding.test,v 1.21 2004/11/30 19:34:51 dgp Exp $ +# RCS: @(#) $Id: encoding.test,v 1.22 2005/04/15 22:41:44 dgp Exp $ package require tcltest 2 namespace import -force ::tcltest::* @@ -556,6 +556,19 @@ foreach from {cp932 shiftjis euc-jp iso2022-jp} { } } +testConstraint testgetdefenc [llength [info commands testgetdefenc]] + +test encoding-26.0 {Tcl_GetDefaultEncodingDir} -constraints { + testgetdefenc +} -setup { + set origDir [testgetdefenc] + testsetdefenc slappy +} -body { + testgetdefenc +} -cleanup { + testsetdefenc $origDir +} -result slappy + file delete {expand}[glob -directory [temporaryDirectory] *.chars *.tcltestout] # ===> Cut here <=== diff --git a/tests/unixInit.test b/tests/unixInit.test index b7bffbd..1b7a6f0 100644 --- a/tests/unixInit.test +++ b/tests/unixInit.test @@ -10,9 +10,9 @@ # 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.45 2004/12/08 02:33:22 dgp Exp $ +# RCS: @(#) $Id: unixInit.test,v 1.46 2005/04/15 22:41:44 dgp Exp $ -package require tcltest 2 +package require tcltest 2.2 namespace import -force ::tcltest::* unset -nocomplain path catch {set oldlang $env(LANG)} @@ -92,40 +92,21 @@ test unixInit-1.2 {initialisation: standard channel type deduction} {unix stdio} } } {OK} -proc getlibpath [list [list program [interpreter]]] { - set f [open "|[list $program]" w+] - fconfigure $f -buffering none - puts $f {puts $::tcl::LibPath; exit} - set path [gets $f] - close $f - return $path -} - -# Some tests require the testgetdefenc command +# The unixInit-2.* tests were written to test the internal routine, +# TclpInitLibraryPath. That routine no longer does the things it used +# to do so those tests are obsolete. Skip them. -testConstraint testgetdefenc [llength [info commands testgetdefenc]] +skip [concat [skip] unixInit-2.*] -unset -nocomplain oldlibrary -catch { - set oldlibrary $env(TCL_LIBRARY) - unset env(TCL_LIBRARY) -} -testConstraint canInitWithoutEnvTclLibrary [expr {[catch getlibpath] == 0}] -if {[info exists oldlibrary]} { - set env(TCL_LIBRARY) $oldlibrary -} - -test unixInit-2.0 {TclpInitLibraryPath: setting tclDefaultEncodingDir} \ - {unix testgetdefenc} { +test unixInit-2.0 {TclpInitLibraryPath: setting tclDefaultEncodingDir} { set origDir [testgetdefenc] testsetdefenc slappy set path [testgetdefenc] testsetdefenc $origDir set path } {slappy} -test unixInit-2.1 {TclpInitLibraryPath: value of installLib, developLib} -constraints { - unix stdio canInitWithoutEnvTclLibrary -} -setup { + +test unixInit-2.1 {TclpInitLibraryPath: value of installLib, developLib} -setup { unset -nocomplain oldlibrary if {[info exists env(TCL_LIBRARY)]} { set oldlibrary $env(TCL_LIBRARY) @@ -148,9 +129,8 @@ test unixInit-2.1 {TclpInitLibraryPath: value of installLib, developLib} -constr unset oldlibrary } } -result {0 0} -test unixInit-2.2 {TclpInitLibraryPath: TCL_LIBRARY} -constraints { - unix stdio canInitWithoutEnvTclLibrary -} -setup { + +test unixInit-2.2 {TclpInitLibraryPath: TCL_LIBRARY} -setup { unset -nocomplain oldlibrary if {[info exists env(TCL_LIBRARY)]} { set oldlibrary $env(TCL_LIBRARY) @@ -169,9 +149,8 @@ test unixInit-2.2 {TclpInitLibraryPath: TCL_LIBRARY} -constraints { unset oldlibrary } } -result "sparkly" -test unixInit-2.3 {TclpInitLibraryPath: TCL_LIBRARY wrong version} -constraints { - unix stdio canInitWithoutEnvTclLibrary -} -setup { + +test unixInit-2.3 {TclpInitLibraryPath: TCL_LIBRARY wrong version} -setup { unset -nocomplain oldlibrary if {[info exists env(TCL_LIBRARY)]} { set oldlibrary $env(TCL_LIBRARY) @@ -190,9 +169,8 @@ test unixInit-2.3 {TclpInitLibraryPath: TCL_LIBRARY wrong version} -constraints unset oldlibrary } } -result [list /a/b/tcl1.7 /a/b/tcl[info tclversion]] -test unixInit-2.4 {TclpInitLibraryPath: TCL_LIBRARY: INTL} -constraints { - unix stdio canInitWithoutEnvTclLibrary knownBug -} -setup { + +test unixInit-2.4 {TclpInitLibraryPath: TCL_LIBRARY: INTL} -setup { if {[info exists env(TCL_LIBRARY)]} { set oldlibrary $env(TCL_LIBRARY) } @@ -211,13 +189,11 @@ test unixInit-2.4 {TclpInitLibraryPath: TCL_LIBRARY: INTL} -constraints { unset oldlibrary } } -result "\xa7" -test unixInit-2.5 {TclpInitLibraryPath: compiled-in library path} \ - {emptyTest unix} { +test unixInit-2.5 {TclpInitLibraryPath: compiled-in library path} { # cannot test } {} -test unixInit-2.6 {TclpInitLibraryPath: executable relative} -constraints { - unix stdio -} -setup { + +test unixInit-2.6 {TclpInitLibraryPath: executable relative} -setup { unset -nocomplain oldlibrary if {[info exists env(TCL_LIBRARY)]} { set oldlibrary $env(TCL_LIBRARY) @@ -248,23 +224,18 @@ test unixInit-2.6 {TclpInitLibraryPath: executable relative} -constraints { } } -result [list [temporaryDirectory]/tmp/sparkly/lib/tcl[info tclversion] [temporaryDirectory]/tmp/lib/tcl[info tclversion]] -test unixInit-2.7 {TclpInitLibraryPath: compiled-in library path} \ - {emptyTest unix} { +test unixInit-2.7 {TclpInitLibraryPath: compiled-in library path} { # would need test command to get defaultLibDir and compare it to # [lindex $auto_path end] } {} + # # The following two tests write to the directory /tmp/sparkly instead # of to [temporaryDirectory]. This is because the failures tested by # these tests need paths near the "root" of the file system to present # themselves. # -testConstraint noSparkly [expr {![file exists [file join /tmp sparkly]]}] -testConstraint noTmpInstall [expr {![file exists \ - [file join /tmp lib tcl[info tclversion]]]}] -test unixInit-2.8 {TclpInitLibraryPath: all absolute pathtype} -constraints { - unix noSparkly noTmpInstall -} -setup { +test unixInit-2.8 {TclpInitLibraryPath: all absolute pathtype} -setup { unset -nocomplain oldlibrary if {[info exists env(TCL_LIBRARY)]} { set oldlibrary $env(TCL_LIBRARY) @@ -325,10 +296,8 @@ test unixInit-2.8 {TclpInitLibraryPath: all absolute pathtype} -constraints { unset oldlibrary } } -result 1 -testConstraint noTmpBuild [expr {![file exists [file join /tmp library]]}] -test unixInit-2.9 {TclpInitLibraryPath: paths relative to executable} -constraints { - unix noSparkly noTmpBuild -} -setup { + +test unixInit-2.9 {TclpInitLibraryPath: paths relative to executable} -setup { # Checking for Bug 438014 unset -nocomplain oldlibrary if {[info exists env(TCL_LIBRARY)]} { @@ -355,9 +324,7 @@ test unixInit-2.9 {TclpInitLibraryPath: paths relative to executable} -constrain } -result [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 { - unix stdio -} -setup { +test unixInit-2.10 {TclpInitLibraryPath: executable relative} -setup { unset -nocomplain oldlibrary if {[info exists env(TCL_LIBRARY)]} { set oldlibrary $env(TCL_LIBRARY) |