summaryrefslogtreecommitdiff
path: root/cell_test.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2019-12-22 00:02:09 +0800
committerxuri <xuri.me@gmail.com>2019-12-22 00:02:09 +0800
commitae2865d9237cfd27d7bc4fbef3870b3361597be8 (patch)
tree175964d3757a0da1bf84c5ff495636baf237b681 /cell_test.go
parent7358dca436f6ca5948a3f2865b14e828863d86a9 (diff)
Improve code coverage unit tests
Diffstat (limited to 'cell_test.go')
-rw-r--r--cell_test.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/cell_test.go b/cell_test.go
index b030622..7d3339f 100644
--- a/cell_test.go
+++ b/cell_test.go
@@ -95,8 +95,15 @@ func TestSetCellBool(t *testing.T) {
}
func TestGetCellFormula(t *testing.T) {
+ // Test get cell formula on not exist worksheet.
f := NewFile()
- f.GetCellFormula("Sheet", "A1")
+ _, err := f.GetCellFormula("SheetN", "A1")
+ assert.EqualError(t, err, "sheet SheetN is not exist")
+
+ // Test get cell formula on no formula cell.
+ f.SetCellValue("Sheet1", "A1", true)
+ _, err = f.GetCellFormula("Sheet1", "A1")
+ assert.NoError(t, err)
}
func ExampleFile_SetCellFloat() {