diff options
Diffstat (limited to 'workbook_test.go')
-rw-r--r-- | workbook_test.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/workbook_test.go b/workbook_test.go index e31caf2..18b222c 100644 --- a/workbook_test.go +++ b/workbook_test.go @@ -10,6 +10,7 @@ import ( func ExampleFile_SetWorkbookPrOptions() { f := NewFile() if err := f.SetWorkbookPrOptions( + Date1904(false), FilterPrivacy(false), CodeName("code"), ); err != nil { @@ -21,9 +22,13 @@ func ExampleFile_SetWorkbookPrOptions() { func ExampleFile_GetWorkbookPrOptions() { f := NewFile() var ( + date1904 Date1904 filterPrivacy FilterPrivacy codeName CodeName ) + if err := f.GetWorkbookPrOptions(&date1904); err != nil { + fmt.Println(err) + } if err := f.GetWorkbookPrOptions(&filterPrivacy); err != nil { fmt.Println(err) } @@ -31,10 +36,12 @@ func ExampleFile_GetWorkbookPrOptions() { fmt.Println(err) } fmt.Println("Defaults:") + fmt.Printf("- date1904: %t\n", date1904) fmt.Printf("- filterPrivacy: %t\n", filterPrivacy) fmt.Printf("- codeName: %q\n", codeName) // Output: // Defaults: + // - date1904: false // - filterPrivacy: true // - codeName: "" } @@ -43,6 +50,11 @@ func TestWorkbookPr(t *testing.T) { f := NewFile() wb := f.workbookReader() wb.WorkbookPr = nil + var date1904 Date1904 + assert.NoError(t, f.GetWorkbookPrOptions(&date1904)) + assert.Equal(t, false, bool(date1904)) + + wb.WorkbookPr = nil var codeName CodeName assert.NoError(t, f.GetWorkbookPrOptions(&codeName)) assert.Equal(t, "", string(codeName)) |