From 4343a826717f73f3345f7ff231565b1dd71d8373 Mon Sep 17 00:00:00 2001 From: sebres Date: Tue, 14 Apr 2020 13:58:10 +0000 Subject: amend to [e9f5ff2f6a]: added missing constraint (testbytestring) --- tests/encoding.test | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/encoding.test b/tests/encoding.test index ce0467a..84d271d 100644 --- a/tests/encoding.test +++ b/tests/encoding.test @@ -33,6 +33,7 @@ proc runtests {} { variable x # Some tests require the testencoding command +testConstraint testbytestring [llength [info commands testbytestring]] testConstraint testencoding [llength [info commands testencoding]] testConstraint fullutf [expr {[format %c 0x010000] != "\ufffd"}] testConstraint exec [llength [info commands exec]] -- cgit v0.12 From 3e8eb733025fb2507052440fa0b2674744322adf Mon Sep 17 00:00:00 2001 From: sebres Date: Tue, 14 Apr 2020 14:39:15 +0000 Subject: partially revert [e9f5ff2f6a] - encoding-15.3 used not existing command "teststringbytes" (should be "testbytesstring"? but it is not an opposite to get same result as convert to identity, so splitted to 3 new cases illustrating the results) --- tests/encoding.test | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/encoding.test b/tests/encoding.test index 84d271d..997b399 100644 --- a/tests/encoding.test +++ b/tests/encoding.test @@ -320,9 +320,18 @@ test encoding-15.2 {UtfToUtfProc null character output} testbytestring { binary scan [testbytestring [encoding convertto utf-8 \u0000]] H* z set z } 00 -test encoding-15.3 {UtfToUtfProc null character input} teststringbytes { +test encoding-15.3.a {UtfToUtfProc null character input} testbytestring { + binary scan [testbytestring \xc0\x80] H* z + set z +} 00 +test encoding-15.3.b {UtfToUtfProc null character input} testbytestring { + set y [encoding convertfrom utf-8 [encoding convertto utf-8 \u0000]] + binary scan [testbytestring $y] H* z + set z +} 00 +test encoding-15.3.c {UtfToUtfProc null character input} { set y [encoding convertfrom utf-8 [encoding convertto utf-8 \u0000]] - binary scan [teststringbytes $y] H* z + binary scan [encoding convertto identity $y] H* z set z } c080 test encoding-15.4 {UtfToUtfProc emoji character input} -body { -- cgit v0.12