summaryrefslogtreecommitdiff
path: root/lib_test.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2021-08-28 09:23:44 +0800
committerxuri <xuri.me@gmail.com>2021-08-28 09:23:44 +0800
commitc3d1d7ddddd02d9d8d39204dd891250222bb9ee4 (patch)
treeb98929deef6a8f2b23049209c218c8aa224bd6ac /lib_test.go
parent7d9b9275bd14556bfcaab7f1d3690b1e54ab75e8 (diff)
Preserve XML control character in bstrUnmarshal result
Diffstat (limited to 'lib_test.go')
-rw-r--r--lib_test.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib_test.go b/lib_test.go
index 025bc85..556ed91 100644
--- a/lib_test.go
+++ b/lib_test.go
@@ -263,21 +263,21 @@ func TestGenXMLNamespace(t *testing.T) {
func TestBstrUnmarshal(t *testing.T) {
bstrs := map[string]string{
"*": "*",
- "*_x0000_": "*",
- "*_x0008_": "*",
- "_x0008_*": "*",
- "*_x0008_*": "**",
+ "*_x0000_": "*\x00",
+ "*_x0008_": "*\b",
+ "_x0008_*": "\b*",
+ "*_x0008_*": "*\b*",
"*_x4F60__x597D_": "*你好",
"*_xG000_": "*_xG000_",
"*_xG05F_x0001_*": "*_xG05F*",
- "*_x005F__x0008_*": "*_x005F_*",
+ "*_x005F__x0008_*": "*_\b*",
"*_x005F_x0001_*": "*_x0001_*",
- "*_x005f_x005F__x0008_*": "*_x005F_*",
+ "*_x005f_x005F__x0008_*": "*_x005F_\b*",
"*_x005F_x005F_xG05F_x0006_*": "*_x005F_xG05F*",
"*_x005F_x005F_x005F_x0006_*": "*_x005F_x0006_*",
- "_x005F__x0008_******": "_x005F_******",
- "******_x005F__x0008_": "******_x005F_",
- "******_x005F__x0008_******": "******_x005F_******",
+ "_x005F__x0008_******": "_\b******",
+ "******_x005F__x0008_": "******_\b",
+ "******_x005F__x0008_******": "******_\b******",
}
for bstr, expected := range bstrs {
assert.Equal(t, expected, bstrUnmarshal(bstr))