summaryrefslogtreecommitdiff
path: root/lib_test.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2021-06-16 15:03:50 +0000
committerxuri <xuri.me@gmail.com>2021-06-16 15:03:50 +0000
commit2cfcf9eb5ff2f332dad0c6adead53ef0500001db (patch)
tree40193c6f633e587832f28d3c65d1a2ec0fc6caef /lib_test.go
parentc62ced7ca7a6cf715f62bd10981560a809c723dd (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.go13
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))
+ }
+}