From 83e12cc4e5242904366a51f642596acbc9f9dd56 Mon Sep 17 00:00:00 2001 From: xuri Date: Fri, 11 Jun 2021 22:48:37 +0800 Subject: 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 --- lib_test.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'lib_test.go') 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)) + } +} -- cgit v1.2.1