diff options
author | HcySunYang <HcySunYang@outlook.com> | 2018-11-02 23:08:31 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2018-11-02 23:08:31 +0800 |
commit | 4dbc78ce0a0d40be189b4c77207cdbb598846c73 (patch) | |
tree | b8295d120ecafa5c7e9e7aad22be09e65fc76aed /excelize_test.go | |
parent | 30122d0346dc751b01c9865af3febb1f99e1f5e0 (diff) |
resolve #273 new feature: protect sheet support
new feature: protect sheet support, relate issue #273
Diffstat (limited to 'excelize_test.go')
-rwxr-xr-x[-rw-r--r--] | excelize_test.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/excelize_test.go b/excelize_test.go index d021b55..f7a70d9 100644..100755 --- a/excelize_test.go +++ b/excelize_test.go @@ -1208,6 +1208,19 @@ func TestSearchSheet(t *testing.T) { t.Log(xlsx.SearchSheet("Sheet1", "A")) } +func TestProtectSheet(t *testing.T) { + xlsx := NewFile() + xlsx.ProtectSheet("Sheet1", nil) + xlsx.ProtectSheet("Sheet1", &FormatSheetProtection{ + Password: "password", + EditScenarios: false, + }) + err := xlsx.SaveAs("./test/Book_protect_sheet.xlsx") + if err != nil { + t.Error(err) + } +} + func trimSliceSpace(s []string) []string { for { if len(s) > 0 && s[len(s)-1] == "" { |