diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-10-18 11:57:36 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-10-18 11:57:36 (GMT) |
| commit | d29c3178051f09e66db3204230d26fa28364fdd4 (patch) | |
| tree | a5f6ebf5a533405ecd7064eb0f69ccdfd61b84eb /tests | |
| parent | afa0f7421bb00ea52020c1118c980b7045a38ddc (diff) | |
| parent | 43d72b8d8e0d029c39b3c9abbb84f196aed496f5 (diff) | |
| download | tcl-d29c3178051f09e66db3204230d26fa28364fdd4.zip tcl-d29c3178051f09e66db3204230d26fa28364fdd4.tar.gz tcl-d29c3178051f09e66db3204230d26fa28364fdd4.tar.bz2 | |
Merge 8.7. Remove -stoponerror option
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/async.test | 7 | ||||
| -rw-r--r-- | tests/cmdAH.test | 4 | ||||
| -rw-r--r-- | tests/encoding.test | 79 | ||||
| -rw-r--r-- | tests/http11.test | 2 | ||||
| -rw-r--r-- | tests/httpPipeline.test | 2 | ||||
| -rw-r--r-- | tests/httpTest.tcl | 2 | ||||
| -rw-r--r-- | tests/httpTestScript.tcl | 2 | ||||
| -rw-r--r-- | tests/httpd11.tcl | 2 | ||||
| -rw-r--r-- | tests/info.test | 2 | ||||
| -rw-r--r-- | tests/namespace.test | 18 | ||||
| -rw-r--r-- | tests/proc.test | 9 | ||||
| -rw-r--r-- | tests/regexp.test | 3 | ||||
| -rw-r--r-- | tests/regexpComp.test | 2 | ||||
| -rw-r--r-- | tests/safe.test | 8 | ||||
| -rw-r--r-- | tests/string.test | 2 | ||||
| -rw-r--r-- | tests/stringObj.test | 2 | ||||
| -rw-r--r-- | tests/tcltests.tcl | 1 |
17 files changed, 94 insertions, 53 deletions
diff --git a/tests/async.test b/tests/async.test index 0f0af0e..2d8f678 100644 --- a/tests/async.test +++ b/tests/async.test @@ -19,6 +19,7 @@ if {"::tcltest" ni [namespace children]} { ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] +testConstraint thread [expr {0 == [catch {package require Thread 2.7-}]}] testConstraint testasync [llength [info commands testasync]] testConstraint knownMsvcBug [expr {![info exists ::env(CI_BUILD_WITH_MSVC)]}] @@ -149,7 +150,7 @@ test async-3.1 {deleting handlers} testasync { } {3 del2 {0 0 0 del1 del2}} test async-4.1 {async interrupting bytecode sequence} -constraints { - testasync + testasync thread } -setup { set hm [testasync create async3] proc nothing {} { @@ -178,7 +179,7 @@ test async-4.1 {async interrupting bytecode sequence} -constraints { testasync delete $hm } test async-4.2 {async interrupting straight bytecode sequence} -constraints { - testasync + testasync thread } -setup { set hm [testasync create async3] } -body { @@ -203,7 +204,7 @@ test async-4.2 {async interrupting straight bytecode sequence} -constraints { testasync delete $hm } test async-4.3 {async interrupting loop-less bytecode sequence} -constraints { - testasync knownMsvcBug + testasync thread knownMsvcBug } -setup { set hm [testasync create async3] } -body { diff --git a/tests/cmdAH.test b/tests/cmdAH.test index 19ec9ec..7f86275 100644 --- a/tests/cmdAH.test +++ b/tests/cmdAH.test @@ -178,7 +178,7 @@ test cmdAH-4.2 {Tcl_EncodingObjCmd} -returnCodes error -body { } -result {unknown or ambiguous subcommand "foo": must be convertfrom, convertto, dirs, names, or system} test cmdAH-4.3 {Tcl_EncodingObjCmd} -returnCodes error -body { encoding convertto -} -result {wrong # args: should be "encoding convertto ?-nothrow|-stoponerror? ?encoding? data"} +} -result {wrong # args: should be "encoding convertto ?-nothrow? ?encoding? data"} test cmdAH-4.4 {Tcl_EncodingObjCmd} -returnCodes error -body { encoding convertto foo bar } -result {unknown encoding "foo"} @@ -200,7 +200,7 @@ test cmdAH-4.6 {Tcl_EncodingObjCmd} -setup { } -result 8C test cmdAH-4.7 {Tcl_EncodingObjCmd} -returnCodes error -body { encoding convertfrom -} -result {wrong # args: should be "encoding convertfrom ?-nothrow|-stoponerror? ?encoding? data"} +} -result {wrong # args: should be "encoding convertfrom ?-nothrow? ?encoding? data"} test cmdAH-4.8 {Tcl_EncodingObjCmd} -returnCodes error -body { encoding convertfrom foo bar } -result {unknown encoding "foo"} diff --git a/tests/encoding.test b/tests/encoding.test index 08c00f2..5f9557b 100644 --- a/tests/encoding.test +++ b/tests/encoding.test @@ -22,6 +22,8 @@ catch { package require -exact tcl::test [info patchlevel] } +testConstraint deprecated [expr {![info exists tcl_precision]}] + proc toutf {args} { variable x lappend x "toutf $args" @@ -287,6 +289,12 @@ test encoding-11.8 {encoding: extended Unicode UTF-16} { test encoding-11.9 {encoding: extended Unicode UTF-16} { viewable [encoding convertto utf-16be 😹] } {Ø=Þ9 (\u00D8=\u00DE9)} +test encoding-11.10 {encoding: extended Unicode UTF-32} { + viewable [encoding convertto utf-32le 😹] +} "9\xF6\x01\x00 (9\\u00F6\\u0001\\u0000)" +test encoding-11.11 {encoding: extended Unicode UTF-32} { + viewable [encoding convertto utf-32be 😹] +} "\x00\x01\xF69 (\\u0000\\u0001\\u00F69)" # OpenEncodingFile is fully tested by the rest of the tests in this file. test encoding-12.1 {LoadTableEncoding: normal encoding} { @@ -461,10 +469,18 @@ test encoding-16.4 {Ucs2ToUtfProc} -body { set val [encoding convertfrom ucs-2 NN] list $val [format %x [scan $val %c]] } -result "乎 4e4e" -test encoding-16.4 {Ucs2ToUtfProc} -body { +test encoding-16.5 {Ucs2ToUtfProc} -body { set val [encoding convertfrom ucs-2 "\xD8\xD8\xDC\xDC"] list $val [format %x [scan $val %c]] } -result "\U460DC 460dc" +test encoding-16.6 {Utf32ToUtfProc} -body { + set val [encoding convertfrom utf-32le NN\0\0] + list $val [format %x [scan $val %c]] +} -result "乎 4e4e" +test encoding-16.7 {Utf32ToUtfProc} -body { + set val [encoding convertfrom utf-32be \0\0NN] + list $val [format %x [scan $val %c]] +} -result "乎 4e4e" test encoding-17.1 {UtfToUtf16Proc} -body { encoding convertto utf-16 "\U460DC" @@ -478,6 +494,12 @@ test encoding-17.3 {UtfToUtf16Proc} -body { test encoding-17.4 {UtfToUtf16Proc} -body { encoding convertto -nothrow utf-16le "\uD8D8" } -result "\xFD\xFF" +test encoding-17.5 {UtfToUtf16Proc} -body { + encoding convertto utf-32le "\U460DC" +} -result "\xDC\x60\x04\x00" +test encoding-17.6 {UtfToUtf16Proc} -body { + encoding convertto utf-32be "\U460DC" +} -result "\x00\x04\x60\xDC" test encoding-18.1 {TableToUtfProc} { } {} @@ -615,51 +637,42 @@ test encoding-24.10 {Parse valid or invalid utf-8} { test encoding-24.11 {Parse valid or invalid utf-8} { string length [encoding convertfrom -nothrow utf-8 "\xEF\xBF\xBF"] } 1 -test encoding-24.12 {Parse valid or invalid utf-8} { - string length [encoding convertfrom -stoponerror utf-8 "\xC0\x80"] -} 1 -test encoding-24.13 {Parse valid or invalid utf-8} -body { - encoding convertfrom -stoponerror utf-8 "\xC0\x81" +test encoding-24.12 {Parse valid or invalid utf-8} -constraints deprecated -body { + encoding convertfrom utf-8 "\xC0\x81" } -returnCodes 1 -result {unexpected byte sequence starting at index 0: '\xC0'} -test encoding-24.14 {Parse valid or invalid utf-8} -body { - encoding convertfrom -stoponerror utf-8 "\xC1\xBF" +test encoding-24.13 {Parse valid or invalid utf-8} -constraints deprecated -body { + encoding convertfrom utf-8 "\xC1\xBF" } -returnCodes 1 -result {unexpected byte sequence starting at index 0: '\xC1'} -test encoding-24.15 {Parse valid or invalid utf-8} { - string length [encoding convertfrom -stoponerror utf-8 "\xC2\x80"] +test encoding-24.14 {Parse valid or invalid utf-8} { + string length [encoding convertfrom utf-8 "\xC2\x80"] } 1 -test encoding-24.16 {Parse valid or invalid utf-8} -body { - encoding convertfrom -stoponerror utf-8 "Z\xE0\x80" +test encoding-24.15 {Parse valid or invalid utf-8} -constraints deprecated -body { + encoding convertfrom utf-8 "Z\xE0\x80" } -returnCodes 1 -result {unexpected byte sequence starting at index 1: '\xE0'} -test encoding-24.17 {Parse valid or invalid utf-8} -constraints testbytestring -body { - encoding convertto -stoponerror utf-8 [testbytestring "Z\u4343\x80"] +test encoding-24.16 {Parse valid or invalid utf-8} -constraints {testbytestring deprecated} -body { + encoding convertto utf-8 [testbytestring "Z\u4343\x80"] } -returnCodes 1 -result {expected byte sequence but character 1 was '䍃' (U+004343)} -test encoding-24.18 {Parse valid or invalid utf-8} -constraints testbytestring -body { - encoding convertto -stoponerror utf-8 [testbytestring "Z\xE0\x80"] +test encoding-24.17 {Parse valid or invalid utf-8} -constraints {testbytestring deprecated} -body { + encoding convertto utf-8 [testbytestring "Z\xE0\x80"] } -result "Z\xC3\xA0\xE2\x82\xAC" -test encoding-24.19 {Parse valid or invalid utf-8} -constraints testbytestring -body { - encoding convertto -stoponerror utf-8 [testbytestring "Z\xE0\x80xxxxxx"] +test encoding-24.18 {Parse valid or invalid utf-8} -constraints {testbytestring deprecated} -body { + encoding convertto utf-8 [testbytestring "Z\xE0\x80xxxxxx"] } -result "Z\xC3\xA0\xE2\x82\xACxxxxxx" -test encoding-24.20 {Parse valid or invalid utf-8} -body { - encoding convertto -stoponerror utf-8 "ZX\uD800" +test encoding-24.19 {Parse valid or invalid utf-8} -constraints deprecated -body { + encoding convertto utf-8 "ZX\uD800" } -returnCodes 1 -match glob -result "unexpected character at index 2: 'U+00D800'" -test encoding-24.21 {Parse with -nothrow but without providing encoding} { +test encoding-24.20 {Parse with -nothrow but without providing encoding} { string length [encoding convertfrom -nothrow "\x20"] } 1 -test encoding-24.22 {Parse with -nothrow but without providing encoding} { +test encoding-24.21 {Parse with -nothrow but without providing encoding} { string length [encoding convertto -nothrow "\x20"] } 1 -test encoding-24.23 {Syntax error, two encodings} -body { +test encoding-24.22 {Syntax error, two encodings} -body { encoding convertfrom iso8859-1 utf-8 "ZX\uD800" -} -returnCodes 1 -result {wrong # args: should be "::tcl::encoding::convertfrom ?-nothrow|-stoponerror? ?encoding? data"} -test encoding-24.24 {Syntax error, two encodings} -body { +} -returnCodes 1 -result {wrong # args: should be "::tcl::encoding::convertfrom ?-nothrow? ?encoding? data"} +test encoding-24.23 {Syntax error, two encodings} -body { encoding convertto iso8859-1 utf-8 "ZX\uD800" -} -returnCodes 1 -result {wrong # args: should be "::tcl::encoding::convertto ?-nothrow|-stoponerror? ?encoding? data"} -test encoding-24.25 {Syntax error, two options} -body { - encoding convertfrom -nothrow -stoponerror "ZX\uD800" -} -returnCodes 1 -result {unknown encoding "-stoponerror"} -test encoding-24.26 {Syntax error, two options} -body { - encoding convertto -nothrow -stoponerror "ZX\uD800" -} -returnCodes 1 -result {unknown encoding "-stoponerror"} +} -returnCodes 1 -result {wrong # args: should be "::tcl::encoding::convertto ?-nothrow? ?encoding? data"} file delete [file join [temporaryDirectory] iso2022.txt] @@ -822,7 +835,7 @@ test encoding-28.0 {all encodings load} -body { llength $name } return $count -} -result [expr {[info exists ::tcl_precision] ? 88 : 87}] +} -result [expr {[info exists ::tcl_precision] ? 92 : 91}] runtests diff --git a/tests/http11.test b/tests/http11.test index f243e56..4f6fb92 100644 --- a/tests/http11.test +++ b/tests/http11.test @@ -2,7 +2,7 @@ # # Test HTTP/1.1 features. # -# Copyright (C) 2009 Pat Thoyts <patthoyts@users.sourceforge.net> +# Copyright © 2009 Pat Thoyts <patthoyts@users.sourceforge.net> # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/tests/httpPipeline.test b/tests/httpPipeline.test index 4306149..4e55a10 100644 --- a/tests/httpPipeline.test +++ b/tests/httpPipeline.test @@ -3,7 +3,7 @@ # Test HTTP/1.1 concurrent requests including # queueing, pipelining and retries. # -# Copyright (C) 2018 Keith Nash <kjnash@users.sourceforge.net> +# Copyright © 2018 Keith Nash <kjnash@users.sourceforge.net> # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/tests/httpTest.tcl b/tests/httpTest.tcl index 8a96d95..1dc6772 100644 --- a/tests/httpTest.tcl +++ b/tests/httpTest.tcl @@ -3,7 +3,7 @@ # Test HTTP/1.1 concurrent requests including # queueing, pipelining and retries. # -# Copyright (C) 2018 Keith Nash <kjnash@users.sourceforge.net> +# Copyright © 2018 Keith Nash <kjnash@users.sourceforge.net> # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/tests/httpTestScript.tcl b/tests/httpTestScript.tcl index a40449a..5437bf6 100644 --- a/tests/httpTestScript.tcl +++ b/tests/httpTestScript.tcl @@ -3,7 +3,7 @@ # Test HTTP/1.1 concurrent requests including # queueing, pipelining and retries. # -# Copyright (C) 2018 Keith Nash <kjnash@users.sourceforge.net> +# Copyright © 2018 Keith Nash <kjnash@users.sourceforge.net> # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/tests/httpd11.tcl b/tests/httpd11.tcl index c7dde43..d0624f8 100644 --- a/tests/httpd11.tcl +++ b/tests/httpd11.tcl @@ -3,7 +3,7 @@ # A simple httpd for testing HTTP/1.1 client features. # Not suitable for use on a internet connected port. # -# Copyright (C) 2009 Pat Thoyts <patthoyts@users.sourceforge.net> +# Copyright © 2009 Pat Thoyts <patthoyts@users.sourceforge.net> # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/tests/info.test b/tests/info.test index ced4435..46f85e7 100644 --- a/tests/info.test +++ b/tests/info.test @@ -20,9 +20,9 @@ if {{::tcltest} ni [namespace children]} { namespace import -force ::tcltest::* } ::tcltest::loadTestedCommands +package require tcltests catch [list package require -exact tcl::test [info patchlevel]] testConstraint zlib [llength [info commands zlib]] -testConstraint nodep [info exists tcl_precision] # Set up namespaces needed to test operation of "info args", "info body", # "info default", and "info procs" with imported procedures. diff --git a/tests/namespace.test b/tests/namespace.test index 6eabf61..c98ad4a 100644 --- a/tests/namespace.test +++ b/tests/namespace.test @@ -1908,6 +1908,24 @@ test namespace-42.10 { unset -nocomplain lst } -returnCodes error -match glob -result {invalid command name *three*} + +test namespace-42.11 { + ensembles: prefix matching segmentation fault + + issue ccc448a6bfd59cbd +} -body { + namespace eval n1 { + namespace ensemble create + namespace export * + proc p1 args {error success} + } + # segmentation fault only occurs in the non-byte-compiled path, so avoid + # byte compilation + set cmd {namespace eva n1 {[namespace parent]::n1 p1}} + {*}$cmd +} -returnCodes error -result success + + test namespace-43.1 {ensembles: dict-driven} { namespace eval ns { namespace export x* diff --git a/tests/proc.test b/tests/proc.test index ab32567..b87af57 100644 --- a/tests/proc.test +++ b/tests/proc.test @@ -325,6 +325,15 @@ test proc-4.8 {TclCreateProc, procbody obj, no leak on multiple iterations} -set test proc-4.9 {[39fed4dae5] Valid Tcl_PkgPresent return} tcl::test { tcl::procbodytest::check } 1 +test proc-4.10 { + TclCreateProc, issue a8579d906a28, argument with no name +} -body { + catch { + proc p1 [list [list [expr {1 + 2}] default]] {} + } +} -cleanup { + catch {rename p1 {}} +} -result 0 test proc-5.1 {Bytecompiling noop; test for correct argument substitution} -body { proc p args {} ; # this will be bytecompiled into t diff --git a/tests/regexp.test b/tests/regexp.test index 6bed21e..a44f2e3 100644 --- a/tests/regexp.test +++ b/tests/regexp.test @@ -17,9 +17,8 @@ if {"::tcltest" ni [namespace children]} { } unset -nocomplain foo - +package require tcltests testConstraint exec [llength [info commands exec]] -testConstraint nodep [info exists tcl_precision] # Used for constraining memory leak tests testConstraint memory [llength [info commands memory]] diff --git a/tests/regexpComp.test b/tests/regexpComp.test index 1587c72..e78c0df 100644 --- a/tests/regexpComp.test +++ b/tests/regexpComp.test @@ -16,7 +16,7 @@ if {"::tcltest" ni [namespace children]} { namespace import -force ::tcltest::* } -testConstraint nodep [info exists tcl_precision] +package require tcltests # Procedure to evaluate a script within a proc, to test compilation # functionality diff --git a/tests/safe.test b/tests/safe.test index 4d65ba3..d5e2f00 100644 --- a/tests/safe.test +++ b/tests/safe.test @@ -1269,7 +1269,7 @@ test safe-11.7 {testing safe encoding} -setup { interp eval $i encoding convertfrom } -returnCodes error -cleanup { safe::interpDelete $i -} -result {wrong # args: should be "encoding convertfrom ?-nothrow|-stoponerror? ?encoding? data"} +} -result {wrong # args: should be "encoding convertfrom ?-nothrow? ?encoding? data"} test safe-11.7.1 {testing safe encoding} -setup { set i [safe::interpCreate] } -body { @@ -1278,7 +1278,7 @@ test safe-11.7.1 {testing safe encoding} -setup { } -returnCodes ok -match glob -cleanup { unset -nocomplain m o safe::interpDelete $i -} -result {wrong # args: should be "encoding convertfrom ?-nothrow|-stoponerror? ?encoding? data" +} -result {wrong # args: should be "encoding convertfrom ?-nothrow? ?encoding? data" while executing "encoding convertfrom" invoked from within @@ -1291,7 +1291,7 @@ test safe-11.8 {testing safe encoding} -setup { interp eval $i encoding convertto } -returnCodes error -cleanup { safe::interpDelete $i -} -result {wrong # args: should be "encoding convertto ?-nothrow|-stoponerror? ?encoding? data"} +} -result {wrong # args: should be "encoding convertto ?-nothrow? ?encoding? data"} test safe-11.8.1 {testing safe encoding} -setup { set i [safe::interpCreate] } -body { @@ -1300,7 +1300,7 @@ test safe-11.8.1 {testing safe encoding} -setup { } -returnCodes ok -match glob -cleanup { unset -nocomplain m o safe::interpDelete $i -} -result {wrong # args: should be "encoding convertto ?-nothrow|-stoponerror? ?encoding? data" +} -result {wrong # args: should be "encoding convertto ?-nothrow? ?encoding? data" while executing "encoding convertto" invoked from within diff --git a/tests/string.test b/tests/string.test index 822899c..6750a5c 100644 --- a/tests/string.test +++ b/tests/string.test @@ -19,6 +19,7 @@ if {"::tcltest" ni [namespace children]} { ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] +package require tcltests # Helper commands to test various optimizations, code paths, and special cases. proc makeByteArray {s} {binary format a* $s} @@ -33,7 +34,6 @@ testConstraint testindexobj [expr {[info commands testindexobj] ne {}}] testConstraint testevalex [expr {[info commands testevalex] ne {}}] testConstraint utf16 [expr {[string length \U010000] == 2}] testConstraint testbytestring [llength [info commands testbytestring]] -testConstraint nodep [info exists tcl_precision] # Used for constraining memory leak tests testConstraint memory [llength [info commands memory]] diff --git a/tests/stringObj.test b/tests/stringObj.test index 135830c..4402185 100644 --- a/tests/stringObj.test +++ b/tests/stringObj.test @@ -19,12 +19,12 @@ if {"::tcltest" ni [namespace children]} { ::tcltest::loadTestedCommands catch [list package require -exact tcl::test [info patchlevel]] +package require tcltests testConstraint testobj [llength [info commands testobj]] testConstraint testbytestring [llength [info commands testbytestring]] testConstraint testdstring [llength [info commands testdstring]] testConstraint tip389 [expr {[string length \U010000] == 2}] -testConstraint nodep [info exists tcl_precision] test stringObj-1.1 {string type registration} testobj { set t [testobj types] diff --git a/tests/tcltests.tcl b/tests/tcltests.tcl index 1ee37d3..f7407b4 100644 --- a/tests/tcltests.tcl +++ b/tests/tcltests.tcl @@ -15,6 +15,7 @@ if {[namespace which testdebug] ne {}} { [testConstraint purify] }] } +testConstraint nodep [info exists tcl_precision] testConstraint fcopy [llength [info commands fcopy]] testConstraint fileevent [llength [info commands fileevent]] testConstraint thread [ |
