diff options
author | dgp <dgp@users.sourceforge.net> | 2006-02-08 21:41:27 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2006-02-08 21:41:27 (GMT) |
commit | c02df4db03405fcafcc2112fb34211157748e459 (patch) | |
tree | feaabb969de44d4d6c82c59dab708581780f8666 /tests/encoding.test | |
parent | 828b7e282d4e1591be7f44c77c513ed0bf170b06 (diff) | |
download | tcl-c02df4db03405fcafcc2112fb34211157748e459.zip tcl-c02df4db03405fcafcc2112fb34211157748e459.tar.gz tcl-c02df4db03405fcafcc2112fb34211157748e459.tar.bz2 |
TIP#258 IMPLEMENTATION
* doc/Encoding.3: New subcommand [encoding dirs].
* doc/encoding.n: New routine Tcl_GetEncodingNameFromEnvironment.
* generic/tcl.decls: Made public:
* generic/tclBasic.c: TclGetEncodingFromObj
* generic/tclCmdAH.c: -> Tcl_GetEncodingFromObj
* generic/tclEncoding.c:TclGetEncodingSearchPath
* generic/tclInt.decls: -> Tcl_GetEncodingSearchPath
* generic/tclInt.h: TclSetEncodingSearchPath
* generic/tclTest.c: -> Tcl_SetEncodingSearchPath
* library/init.tcl: Removed commands:
* tests/cmdAH.test: [tcl::unsupported::EncodingDirs]
* tests/encoding.test: [testencoding path] (Tcltest)
* unix/tclUnixInit.c: [Patch 1413934].
* win/tclWinInit.c:
* generic/tclDecls.h: make genstubs
* generic/tclIntDecls.h:
* generic/tclStubInit.c:
Diffstat (limited to 'tests/encoding.test')
-rw-r--r-- | tests/encoding.test | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/tests/encoding.test b/tests/encoding.test index dc4fd8c..1de8880 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.23 2005/05/10 18:35:18 kennykb Exp $ +# RCS: @(#) $Id: encoding.test,v 1.24 2006/02/08 21:41:28 dgp Exp $ package require tcltest 2 namespace import -force ::tcltest::* @@ -56,14 +56,14 @@ test encoding-2.1 {Tcl_FreeEncoding: refcount == 0} { } {8C} test encoding-2.2 {Tcl_FreeEncoding: refcount != 0} {testencoding} { set system [encoding system] - set path [testencoding path] + set path [encoding dirs] encoding system shiftjis ;# incr ref count - testencoding path [list [pwd]] + encoding dirs [list [pwd]] set x [encoding convertto shiftjis \u4e4e] ;# old one found encoding system identity lappend x [catch {encoding convertto shiftjis \u4e4e} msg] $msg encoding system identity - testencoding path $path + encoding dirs $path encoding system $system set x } "\u008c\u00c1 1 {unknown encoding \"shiftjis\"}" @@ -88,20 +88,20 @@ test encoding-4.1 {Tcl_GetEncodingNames} {testencoding} { makeDirectory [file join tmp encoding] makeFile {} [file join tmp encoding junk.enc] makeFile {} [file join tmp encoding junk2.enc] - set path [testencoding path] - testencoding path {} + set path [encoding dirs] + encoding dirs {} catch {unset encodings} catch {unset x} foreach encoding [encoding names] { set encodings($encoding) 1 } - testencoding path [list [file join [pwd] encoding]] + encoding dirs [list [file join [pwd] encoding]] foreach encoding [encoding names] { if {![info exists encodings($encoding)]} { lappend x $encoding } } - testencoding path $path + encoding dirs $path cd [workingDirectory] removeFile [file join tmp encoding junk2.enc] removeFile [file join tmp encoding junk.enc] @@ -209,11 +209,11 @@ proc viewable {str} { test encoding-11.1 {LoadEncodingFile: unknown encoding} {testencoding} { set system [encoding system] - set path [testencoding path] + set path [encoding dirs] encoding system iso8859-1 - testencoding path {} + encoding dirs {} set x [list [catch {encoding convertto jis0208 \u4e4e} msg] $msg] - testencoding path $path + encoding dirs $path encoding system $system lappend x [encoding convertto jis0208 \u4e4e] } {1 {unknown encoding "jis0208"} 8C} @@ -234,10 +234,10 @@ test encoding-11.5.1 {LoadEncodingFile: escape file} { } [viewable "\x1b\$B8C\x1b(B"] test encoding-11.6 {LoadEncodingFile: invalid file} {testencoding} { set system [encoding system] - set path [testencoding path] + set path [encoding dirs] encoding system identity cd [temporaryDirectory] - testencoding path [file join tmp encoding] + encoding dirs [file join tmp encoding] makeDirectory tmp makeDirectory [file join tmp encoding] set f [open [file join tmp encoding splat.enc] w] @@ -249,7 +249,7 @@ test encoding-11.6 {LoadEncodingFile: invalid file} {testencoding} { removeDirectory [file join tmp encoding] removeDirectory tmp cd [workingDirectory] - testencoding path $path + encoding dirs $path encoding system $system set x } {1 {invalid encoding file "splat"}} |