diff options
author | xuri <xuri.me@gmail.com> | 2021-06-16 15:03:50 +0000 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2021-06-16 15:03:50 +0000 |
commit | 2cfcf9eb5ff2f332dad0c6adead53ef0500001db (patch) | |
tree | 40193c6f633e587832f28d3c65d1a2ec0fc6caef /lib_test.go | |
parent | c62ced7ca7a6cf715f62bd10981560a809c723dd (diff) |
encode the escaped string literal which not permitted in an XML 1.0 document
Diffstat (limited to 'lib_test.go')
-rw-r--r-- | lib_test.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib_test.go b/lib_test.go index ad20946..315688f 100644 --- a/lib_test.go +++ b/lib_test.go @@ -258,3 +258,16 @@ func TestBstrUnmarshal(t *testing.T) { assert.Equal(t, expected, bstrUnmarshal(bstr)) } } + +func TestBstrMarshal(t *testing.T) { + bstrs := map[string]string{ + "*_xG05F_*": "*_xG05F_*", + "*_x0008_*": "*_x005F_x0008_*", + "*_x005F_*": "*_x005F_x005F_*", + "*_x005F_xG006_*": "*_x005F_x005F_xG006_*", + "*_x005F_x0006_*": "*_x005F_x005F_x005F_x0006_*", + } + for bstr, expected := range bstrs { + assert.Equal(t, expected, bstrMarshal(bstr)) + } +} |