summaryrefslogtreecommitdiff
path: root/excelize_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'excelize_test.go')
-rwxr-xr-x[-rw-r--r--]excelize_test.go13
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] == "" {