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.

rberteig 2017-03-31 00:11 trunk
Commit 4bbd5c3e47544f5f06ed52475ee2b4cd49eb24fe23f35f6a50087b85ea2fe22f
1 file changed +12 -10
--- test/commit-warning.test
+++ test/commit-warning.test
@@ -87,18 +87,20 @@
8787
write_file utf-8-bom-emoji "\xef\xbb\xbf$emoji"
8888
8989
# UTF-16 uses 16-bit values to cover all valid unicode code points
9090
# from U+0 to U+10FFFF, using surrogate pairs to escape the BMP.
9191
# 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"
100102
set le16 [read_file [file join $testdir utf16le.txt]]
101103
set be16 [read_file [file join $testdir utf16be.txt]]
102104
write_file utf-16le.txt $le16
103105
write_file utf-16be.txt $be16
104106
write_file utf-nobom-16le.txt [string range $le16 2 end]
@@ -120,12 +122,12 @@
120122
0\tline-1024\t
121123
0\tline-4096\t
122124
1\tline-64K\tlong lines
123125
1\tline-8192\tlong lines
124126
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
127129
1\tutf-16be-hello\tbinary data
128130
1\tutf-16be.txt\tUnicode
129131
1\tutf-16le-bombe-hello\tUnicode
130132
1\tutf-16le-bomle-hello\tUnicode
131133
1\tutf-16le-hello\tbinary data
132134
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button