Tcl Source Code

Check-in [21ded00dfb]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Test TableFromUtfProc() with strict handling of encoding errors.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-branch
Files: files | file ages | folders
SHA3-256: 21ded00dfb659fcfc98ef149a00ff0bf467735ae177e6480e719e7cd03b7de25
User & Date: pooryorick 2023-01-25 10:02:27
Context
2023-01-26
23:55
Fix for [ee08ed090b0a5408], sporadic segmentation fault in coroutine.test/coroutine-7.4. check-in: 417d67fc63 user: pooryorick tags: core-8-branch
2023-01-25
17:09
Experiment: make "encoding" mandatory, when preceded by -strict/-failvar/-nocomplain options Closed-Leaf check-in: af129eecfb user: jan.nijtmans tags: encoding_mandatory
10:02
Test TableFromUtfProc() with strict handling of encoding errors. check-in: 21ded00dfb user: pooryorick tags: core-8-branch
02:52
Test TableFromUtfProc() with strict handling of encoding errors. Closed-Leaf check-in: c2243f4740 user: pooryorick tags: TableFromUtfProc-test
2023-01-24
20:00
First part of fix for [4a7397e0b3]. Not complete yet. check-in: 5d433e183c user: jan.nijtmans tags: core-8-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tests/encoding.test.

509
510
511
512
513
514
515

516


517
518
519
520
521
522
523
524
test encoding-17.9 {Utf32ToUtfProc} -body {
    encoding convertfrom -strict utf-32 "\xFF\xFF\xFF\xFF"
} -returnCodes error -result {unexpected byte sequence starting at index 0: '\xFF'}
test encoding-17.10 {Utf32ToUtfProc} -body {
    encoding convertfrom -nocomplain utf-32 "\xFF\xFF\xFF\xFF"
} -result \uFFFD


test encoding-18.1 {TableToUtfProc} {


} {}

test encoding-19.1 {TableFromUtfProc} {
} {}

test encoding-20.1 {TableFreefProc} {
} {}








>
|
>
>
|







509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
test encoding-17.9 {Utf32ToUtfProc} -body {
    encoding convertfrom -strict utf-32 "\xFF\xFF\xFF\xFF"
} -returnCodes error -result {unexpected byte sequence starting at index 0: '\xFF'}
test encoding-17.10 {Utf32ToUtfProc} -body {
    encoding convertfrom -nocomplain utf-32 "\xFF\xFF\xFF\xFF"
} -result \uFFFD


test encoding-18.1 {TableToUtfProc error on invalid input with -strict} -body {
	list [catch {encoding convertto -strict jis0208 \\} res] $res
} -result {1 {unexpected character at index 0: 'U+00005C'}}


test encoding-19.1 {TableFromUtfProc} {
} {}

test encoding-20.1 {TableFreefProc} {
} {}

910
911
912
913
914
915
916

917
918
919
920
921
922
923
924
925
    list \
        [testencoding nullength ascii] \
        [testencoding nullength utf-16] \
        [testencoding nullength utf-32] \
        [testencoding nullength gb12345] \
        [testencoding nullength ksc5601]
} -result {1 2 4 2 2}


# cleanup
namespace delete ::tcl::test::encoding
::tcltest::cleanupTests
return

# Local Variables:
# mode: tcl
# End:







>









913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
    list \
        [testencoding nullength ascii] \
        [testencoding nullength utf-16] \
        [testencoding nullength utf-32] \
        [testencoding nullength gb12345] \
        [testencoding nullength ksc5601]
} -result {1 2 4 2 2}


# cleanup
namespace delete ::tcl::test::encoding
::tcltest::cleanupTests
return

# Local Variables:
# mode: tcl
# End: