From 3bfb46688df438a9f547a3e56a44639bd66905c2 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 3 Jul 2023 13:46:54 +0000 Subject: Temporary disable tests io-7.3 and chanio-7.3, which fail in debug mode. Ticket [5be203d6ca] created. --- tests/chanio.test | 5 +++-- tests/io.test | 3 ++- tests/tcltests.tcl | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/chanio.test b/tests/chanio.test index c5d3aca..9dad818 100644 --- a/tests/chanio.test +++ b/tests/chanio.test @@ -1090,9 +1090,10 @@ test chan-io-7.2 {FilterInputBytes: split up character in middle of buffer} -bod } -cleanup { chan close $f } -result {10 1234567890 0} +# This testcase fails in "debug" builds. See: [] test chan-io-7.3 {FilterInputBytes: split up character at EOF} -setup { set x "" -} -constraints {testchannel} -body { +} -constraints {testchannel ndebug} -body { set f [open $path(test1) w] chan configure $f -encoding binary chan puts -nonewline $f "1234567890123\x82\x4F\x82\x50\x82" @@ -1104,7 +1105,7 @@ test chan-io-7.3 {FilterInputBytes: split up character at EOF} -setup { lappend x [chan gets $f line] $line } -cleanup { chan close $f -} -result [list 16 "123456789012301\x82" 18 0 1 -1 ""] +} -result [list 16 "123456789012301\x83" 18 0 1 -1 ""] test chan-io-7.4 {FilterInputBytes: recover from split up character} -setup { variable x "" } -constraints {stdio fileevent} -body { diff --git a/tests/io.test b/tests/io.test index ca636ce..ad68bf1 100644 --- a/tests/io.test +++ b/tests/io.test @@ -1124,7 +1124,8 @@ test io-7.2 {FilterInputBytes: split up character in middle of buffer} { close $f set x } [list 10 "1234567890" 0] -test io-7.3 {FilterInputBytes: split up character at EOF} {testchannel} { +# This testcase fails in "debug" builds. See: [5be203d6ca] +test io-7.3 {FilterInputBytes: split up character at EOF} {testchannel ndebug} { set f [open $path(test1) w] fconfigure $f -encoding binary puts -nonewline $f "1234567890123\x82\x4F\x82\x50\x82" diff --git a/tests/tcltests.tcl b/tests/tcltests.tcl index 61366a4..0cabaaa 100644 --- a/tests/tcltests.tcl +++ b/tests/tcltests.tcl @@ -8,6 +8,7 @@ namespace import ::tcltest::* testConstraint exec [llength [info commands exec]] testConstraint deprecated [expr {![tcl::build-info no-deprecate]}] testConstraint debug [tcl::build-info debug] +testConstraint ndebug [expr {![tcl::build-info debug]}] testConstraint purify [tcl::build-info purify] testConstraint debugpurify [ expr { -- cgit v0.12 From ee7499c2e3ad1818ced2a7f1dc7c11f9ad9d69c6 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 3 Jul 2023 13:51:28 +0000 Subject: Fix comment (missing ticket ID) --- tests/chanio.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/chanio.test b/tests/chanio.test index 9dad818..8115abb 100644 --- a/tests/chanio.test +++ b/tests/chanio.test @@ -1090,7 +1090,7 @@ test chan-io-7.2 {FilterInputBytes: split up character in middle of buffer} -bod } -cleanup { chan close $f } -result {10 1234567890 0} -# This testcase fails in "debug" builds. See: [] +# This testcase fails in "debug" builds. See: [5be203d6ca] test chan-io-7.3 {FilterInputBytes: split up character at EOF} -setup { set x "" } -constraints {testchannel ndebug} -body { -- cgit v0.12 From 77c8868be4772aedccdcfa9fef6c7cc5c8c236d3 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 3 Jul 2023 14:08:41 +0000 Subject: Fix testcase (broken by previous commit) --- tests/chanio.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/chanio.test b/tests/chanio.test index 8115abb..fc8620f 100644 --- a/tests/chanio.test +++ b/tests/chanio.test @@ -1105,7 +1105,7 @@ test chan-io-7.3 {FilterInputBytes: split up character at EOF} -setup { lappend x [chan gets $f line] $line } -cleanup { chan close $f -} -result [list 16 "123456789012301\x83" 18 0 1 -1 ""] +} -result [list 16 "123456789012301\x82" 18 0 1 -1 ""] test chan-io-7.4 {FilterInputBytes: recover from split up character} -setup { variable x "" } -constraints {stdio fileevent} -body { -- cgit v0.12 From 6416a20fd8e2a665f23a1df31e0881b7a91185d4 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 3 Jul 2023 14:09:23 +0000 Subject: Adapt tcltest::Asciify, so it's usable for Tcl 8.5 and 8.6 too --- library/tcltest/tcltest.tcl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/library/tcltest/tcltest.tcl b/library/tcltest/tcltest.tcl index ff3f250..c7aee29 100644 --- a/library/tcltest/tcltest.tcl +++ b/library/tcltest/tcltest.tcl @@ -29,6 +29,7 @@ namespace eval tcltest { # yourself. You don't need tcltest to wrap it for you. variable version [package provide Tcl] variable patchLevel [info patchlevel] + variable fullutf [package vsatisfies $version 8.7-] ##### Export the public tcltest procs; several categories # @@ -1150,16 +1151,17 @@ proc tcltest::SafeFetch {n1 n2 op} { # None. proc tcltest::Asciify {s} { + variable fullutf set print "" foreach c [split $s ""] { if {[string is print $c] && (($c <= "\x7E") || ($c == "\n"))} { append print $c - } elseif {$c <= "\xFF"} { + } elseif {$c < "\u0100"} { append print \\x[format %02X [scan $c %c]] - } elseif {$c <= "\xFFFF"} { - append print \\u[format %04X [scan $c %c]] - } else { + } elseif {$fullutf && ($c >= "\U10000")} { append print \\U[format %08X [scan $c %c]] + } else { + append print \\u[format %04X [scan $c %c]] } } return $print -- cgit v0.12