Fossil SCM
Fixed bug in test files generated in commit-warning tests that caused some UCS-2 (aka UTF-16) files to have an odd byte length and be seen as binary instead of Unicode.
Commit
4bbd5c3e47544f5f06ed52475ee2b4cd49eb24fe23f35f6a50087b85ea2fe22f
Parent
54cf4397f499fa5…
1 file changed
+12
-10
+12
-10
| --- test/commit-warning.test | ||
| +++ test/commit-warning.test | ||
| @@ -87,18 +87,20 @@ | ||
| 87 | 87 | write_file utf-8-bom-emoji "\xef\xbb\xbf$emoji" |
| 88 | 88 | |
| 89 | 89 | # UTF-16 uses 16-bit values to cover all valid unicode code points |
| 90 | 90 | # from U+0 to U+10FFFF, using surrogate pairs to escape the BMP. |
| 91 | 91 | # Interchange require knowing (and preserving) byte order. |
| 92 | -write_file utf-16le-hello "h\x00e\x00l\x00l\x00o\x00\n\x00" | |
| 93 | -write_file utf-16be-hello "\x00h\x00e\x00l\x00l\x00o\x00\n" | |
| 94 | -set bomLE "\xff\xfeh" | |
| 95 | -set bomBE "\xfe\xffh" | |
| 96 | -write_file utf-16le-bomle-hello "$bomLE\x00e\x00l\x00l\x00o\x00\n\x00" | |
| 97 | -write_file utf-16be-bombe-hello "$bomBE\x00h\x00e\x00l\x00l\x00o\x00\n" | |
| 98 | -write_file utf-16le-bombe-hello "$bomBE\x00e\x00l\x00l\x00o\x00\n\x00" | |
| 99 | -write_file utf-16be-bomle-hello "$bomLE\x00h\x00e\x00l\x00l\x00o\x00\n" | |
| 92 | +set hello16LE "h\x00e\x00l\x00l\x00o\x00\n\x00" | |
| 93 | +set hello16BE "\x00h\x00e\x00l\x00l\x00o\x00\n" | |
| 94 | +write_file utf-16le-hello $hello16LE | |
| 95 | +write_file utf-16be-hello $hello16BE | |
| 96 | +set bomLE "\xff\xfe" | |
| 97 | +set bomBE "\xfe\xff" | |
| 98 | +write_file utf-16le-bomle-hello "$bomLE$hello16LE" | |
| 99 | +write_file utf-16be-bombe-hello "$bomBE$hello16BE" | |
| 100 | +write_file utf-16le-bombe-hello "$bomBE$hello16LE" | |
| 101 | +write_file utf-16be-bomle-hello "$bomLE$hello16BE" | |
| 100 | 102 | set le16 [read_file [file join $testdir utf16le.txt]] |
| 101 | 103 | set be16 [read_file [file join $testdir utf16be.txt]] |
| 102 | 104 | write_file utf-16le.txt $le16 |
| 103 | 105 | write_file utf-16be.txt $be16 |
| 104 | 106 | write_file utf-nobom-16le.txt [string range $le16 2 end] |
| @@ -120,12 +122,12 @@ | ||
| 120 | 122 | 0\tline-1024\t |
| 121 | 123 | 0\tline-4096\t |
| 122 | 124 | 1\tline-64K\tlong lines |
| 123 | 125 | 1\tline-8192\tlong lines |
| 124 | 126 | 0\tplain.txt\t |
| 125 | -1\tutf-16be-bombe-hello\tbinary data | |
| 126 | -1\tutf-16be-bomle-hello\tbinary data | |
| 127 | +1\tutf-16be-bombe-hello\tUnicode | |
| 128 | +1\tutf-16be-bomle-hello\tUnicode | |
| 127 | 129 | 1\tutf-16be-hello\tbinary data |
| 128 | 130 | 1\tutf-16be.txt\tUnicode |
| 129 | 131 | 1\tutf-16le-bombe-hello\tUnicode |
| 130 | 132 | 1\tutf-16le-bomle-hello\tUnicode |
| 131 | 133 | 1\tutf-16le-hello\tbinary data |
| 132 | 134 |
| --- test/commit-warning.test | |
| +++ test/commit-warning.test | |
| @@ -87,18 +87,20 @@ | |
| 87 | write_file utf-8-bom-emoji "\xef\xbb\xbf$emoji" |
| 88 | |
| 89 | # UTF-16 uses 16-bit values to cover all valid unicode code points |
| 90 | # from U+0 to U+10FFFF, using surrogate pairs to escape the BMP. |
| 91 | # Interchange require knowing (and preserving) byte order. |
| 92 | write_file utf-16le-hello "h\x00e\x00l\x00l\x00o\x00\n\x00" |
| 93 | write_file utf-16be-hello "\x00h\x00e\x00l\x00l\x00o\x00\n" |
| 94 | set bomLE "\xff\xfeh" |
| 95 | set bomBE "\xfe\xffh" |
| 96 | write_file utf-16le-bomle-hello "$bomLE\x00e\x00l\x00l\x00o\x00\n\x00" |
| 97 | write_file utf-16be-bombe-hello "$bomBE\x00h\x00e\x00l\x00l\x00o\x00\n" |
| 98 | write_file utf-16le-bombe-hello "$bomBE\x00e\x00l\x00l\x00o\x00\n\x00" |
| 99 | write_file utf-16be-bomle-hello "$bomLE\x00h\x00e\x00l\x00l\x00o\x00\n" |
| 100 | set le16 [read_file [file join $testdir utf16le.txt]] |
| 101 | set be16 [read_file [file join $testdir utf16be.txt]] |
| 102 | write_file utf-16le.txt $le16 |
| 103 | write_file utf-16be.txt $be16 |
| 104 | write_file utf-nobom-16le.txt [string range $le16 2 end] |
| @@ -120,12 +122,12 @@ | |
| 120 | 0\tline-1024\t |
| 121 | 0\tline-4096\t |
| 122 | 1\tline-64K\tlong lines |
| 123 | 1\tline-8192\tlong lines |
| 124 | 0\tplain.txt\t |
| 125 | 1\tutf-16be-bombe-hello\tbinary data |
| 126 | 1\tutf-16be-bomle-hello\tbinary data |
| 127 | 1\tutf-16be-hello\tbinary data |
| 128 | 1\tutf-16be.txt\tUnicode |
| 129 | 1\tutf-16le-bombe-hello\tUnicode |
| 130 | 1\tutf-16le-bomle-hello\tUnicode |
| 131 | 1\tutf-16le-hello\tbinary data |
| 132 |
| --- test/commit-warning.test | |
| +++ test/commit-warning.test | |
| @@ -87,18 +87,20 @@ | |
| 87 | write_file utf-8-bom-emoji "\xef\xbb\xbf$emoji" |
| 88 | |
| 89 | # UTF-16 uses 16-bit values to cover all valid unicode code points |
| 90 | # from U+0 to U+10FFFF, using surrogate pairs to escape the BMP. |
| 91 | # Interchange require knowing (and preserving) byte order. |
| 92 | set hello16LE "h\x00e\x00l\x00l\x00o\x00\n\x00" |
| 93 | set hello16BE "\x00h\x00e\x00l\x00l\x00o\x00\n" |
| 94 | write_file utf-16le-hello $hello16LE |
| 95 | write_file utf-16be-hello $hello16BE |
| 96 | set bomLE "\xff\xfe" |
| 97 | set bomBE "\xfe\xff" |
| 98 | write_file utf-16le-bomle-hello "$bomLE$hello16LE" |
| 99 | write_file utf-16be-bombe-hello "$bomBE$hello16BE" |
| 100 | write_file utf-16le-bombe-hello "$bomBE$hello16LE" |
| 101 | write_file utf-16be-bomle-hello "$bomLE$hello16BE" |
| 102 | set le16 [read_file [file join $testdir utf16le.txt]] |
| 103 | set be16 [read_file [file join $testdir utf16be.txt]] |
| 104 | write_file utf-16le.txt $le16 |
| 105 | write_file utf-16be.txt $be16 |
| 106 | write_file utf-nobom-16le.txt [string range $le16 2 end] |
| @@ -120,12 +122,12 @@ | |
| 122 | 0\tline-1024\t |
| 123 | 0\tline-4096\t |
| 124 | 1\tline-64K\tlong lines |
| 125 | 1\tline-8192\tlong lines |
| 126 | 0\tplain.txt\t |
| 127 | 1\tutf-16be-bombe-hello\tUnicode |
| 128 | 1\tutf-16be-bomle-hello\tUnicode |
| 129 | 1\tutf-16be-hello\tbinary data |
| 130 | 1\tutf-16be.txt\tUnicode |
| 131 | 1\tutf-16le-bombe-hello\tUnicode |
| 132 | 1\tutf-16le-bomle-hello\tUnicode |
| 133 | 1\tutf-16le-hello\tbinary data |
| 134 |