summaryrefslogtreecommitdiff
path: root/docProps_test.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2022-11-12 00:02:11 +0800
committerxuri <xuri.me@gmail.com>2022-11-12 00:16:23 +0800
commitbd5dd17673f767b9f4643423c77eec486f2ad53f (patch)
treed1ceaf5f7eeff101bcf5b3f9a861a8b115088718 /docProps_test.go
parent58b5dae5eb4948a3cde238ced1ae05db159749f5 (diff)
This is a breaking change, remove partial internal error log print, throw XML deserialize error
- Add error return value for the `GetComments`, `GetDefaultFont` and `SetDefaultFont` functions - Update unit tests
Diffstat (limited to 'docProps_test.go')
-rw-r--r--docProps_test.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/docProps_test.go b/docProps_test.go
index 545059d..64b690c 100644
--- a/docProps_test.go
+++ b/docProps_test.go
@@ -42,7 +42,7 @@ func TestSetAppProps(t *testing.T) {
// Test unsupported charset
f = NewFile()
f.Pkg.Store(defaultXMLPathDocPropsApp, MacintoshCyrillicCharset)
- assert.EqualError(t, f.SetAppProps(&AppProperties{}), "xml decode error: XML syntax error on line 1: invalid UTF-8")
+ assert.EqualError(t, f.SetAppProps(&AppProperties{}), "XML syntax error on line 1: invalid UTF-8")
}
func TestGetAppProps(t *testing.T) {
@@ -58,11 +58,11 @@ func TestGetAppProps(t *testing.T) {
assert.NoError(t, err)
assert.NoError(t, f.Close())
- // Test unsupported charset
+ // Test get application properties with unsupported charset.
f = NewFile()
f.Pkg.Store(defaultXMLPathDocPropsApp, MacintoshCyrillicCharset)
_, err = f.GetAppProps()
- assert.EqualError(t, err, "xml decode error: XML syntax error on line 1: invalid UTF-8")
+ assert.EqualError(t, err, "XML syntax error on line 1: invalid UTF-8")
}
func TestSetDocProps(t *testing.T) {
@@ -94,7 +94,7 @@ func TestSetDocProps(t *testing.T) {
// Test unsupported charset
f = NewFile()
f.Pkg.Store(defaultXMLPathDocPropsCore, MacintoshCyrillicCharset)
- assert.EqualError(t, f.SetDocProps(&DocProperties{}), "xml decode error: XML syntax error on line 1: invalid UTF-8")
+ assert.EqualError(t, f.SetDocProps(&DocProperties{}), "XML syntax error on line 1: invalid UTF-8")
}
func TestGetDocProps(t *testing.T) {
@@ -110,9 +110,9 @@ func TestGetDocProps(t *testing.T) {
assert.NoError(t, err)
assert.NoError(t, f.Close())
- // Test unsupported charset
+ // Test get workbook properties with unsupported charset.
f = NewFile()
f.Pkg.Store(defaultXMLPathDocPropsCore, MacintoshCyrillicCharset)
_, err = f.GetDocProps()
- assert.EqualError(t, err, "xml decode error: XML syntax error on line 1: invalid UTF-8")
+ assert.EqualError(t, err, "XML syntax error on line 1: invalid UTF-8")
}