diff options
author | q523591 <523591643@qq.com> | 2018-11-04 23:14:43 +0800 |
---|---|---|
committer | q523591 <523591643@qq.com> | 2018-11-04 23:14:43 +0800 |
commit | 51857a217d6eec867d70f948104177e728c19bf5 (patch) | |
tree | 35be12e2af1a238a7dc6b8210603ae67541a622d /excelize_test.go | |
parent | 4dbc78ce0a0d40be189b4c77207cdbb598846c73 (diff) |
New function `UnprotectSheet()` has been added
Diffstat (limited to 'excelize_test.go')
-rw-r--r--[-rwxr-xr-x] | excelize_test.go | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/excelize_test.go b/excelize_test.go index f7a70d9..3860e17 100755..100644 --- a/excelize_test.go +++ b/excelize_test.go @@ -128,7 +128,7 @@ func TestOpenFile(t *testing.T) { } err = xlsx.Save() if err != nil { - t.Log(err) + t.Error(err) } // Test write file to not exist directory. err = xlsx.SaveAs("") @@ -1221,6 +1221,18 @@ func TestProtectSheet(t *testing.T) { } } +func TestUnprotectSheet(t *testing.T) { + xlsx, err := OpenFile("./test/Book1.xlsx") + if err != nil { + t.Error(err) + } + xlsx.UnprotectSheet("Sheet1") + err = xlsx.Save() + if err != nil { + t.Error(err) + } +} + func trimSliceSpace(s []string) []string { for { if len(s) > 0 && s[len(s)-1] == "" { |