diff options
author | xuri <xuri.me@gmail.com> | 2021-06-11 22:48:37 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2021-06-11 22:48:37 +0800 |
commit | 83e12cc4e5242904366a51f642596acbc9f9dd56 (patch) | |
tree | af3d4ecbebdd19b55bc0651d5e88bc0bc6683850 /lib_test.go | |
parent | 38162539b61b2b429b0498198ed58e1ef53d284b (diff) |
support escaped string literal basic string and use GitHub Action instead of TravisCI
- Note that: travis-ci.org will shutdown on June 15th, 2021, and I don't have enough permission to migrate this project to travis-ci.com currently
Diffstat (limited to 'lib_test.go')
-rw-r--r-- | lib_test.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib_test.go b/lib_test.go index eb0a289..bd28c7e 100644 --- a/lib_test.go +++ b/lib_test.go @@ -234,3 +234,22 @@ func TestGenXMLNamespace(t *testing.T) { {Name: xml.Name{Space: NameSpaceXML, Local: "space"}, Value: "preserve"}, }), `xml:space="preserve">`) } + +func TestBstrUnmarshal(t *testing.T) { + bstrs := map[string]string{ + "*": "*", + "*_x0008_": "*", + "_x0008_*": "*", + "*_x0008_*": "**", + "*_x005F__x0008_*": "*_x005F_*", + "*_x005F_x0001_*": "*_x0001_*", + "*_x005F_x005F_x005F_x0006_*": "*_x005F_x0006_*", + "_x005F__x0008_******": "_x005F_******", + "******_x005F__x0008_": "******_x005F_", + "******_x005F__x0008_******": "******_x005F_******", + "*_x005F_x005F__x0008_*": "*_x005F_*", + } + for bstr, expected := range bstrs { + assert.Equal(t, expected, bstrUnmarshal(bstr)) + } +} |