diff options
author | xuri <xuri.me@gmail.com> | 2022-07-16 12:50:13 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2022-07-16 12:50:40 +0800 |
commit | 40ed1d1b81b4d30165bb73e9406e59ddbdb76fe2 (patch) | |
tree | 10bb74843b1272e7f9706959cd498ac70da25c70 /table_test.go | |
parent | 6429588e1448f70539774a88840f094829cb9e07 (diff) |
Fix potential file corrupted when changing cell value or the col/row
- Remove shared formula subsequent cell when setting the cell values
- Support adjust table range when removing and inserting column/row
Diffstat (limited to 'table_test.go')
-rw-r--r-- | table_test.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/table_test.go b/table_test.go index 0a74b1b..5941c50 100644 --- a/table_test.go +++ b/table_test.go @@ -45,6 +45,12 @@ func TestAddTable(t *testing.T) { assert.EqualError(t, f.addTable("sheet1", "", 1, 1, 0, 0, 0, nil), "invalid cell coordinates [0, 0]") } +func TestSetTableHeader(t *testing.T) { + f := NewFile() + _, err := f.setTableHeader("Sheet1", 1, 0, 1) + assert.EqualError(t, err, "invalid cell coordinates [1, 0]") +} + func TestAutoFilter(t *testing.T) { outFile := filepath.Join("test", "TestAutoFilter%d.xlsx") @@ -72,7 +78,7 @@ func TestAutoFilter(t *testing.T) { }) } - // testing AutoFilter with illegal cell coordinates. + // Test AutoFilter with illegal cell coordinates. assert.EqualError(t, f.AutoFilter("Sheet1", "A", "B1", ""), newCellNameToCoordinatesError("A", newInvalidCellNameError("A")).Error()) assert.EqualError(t, f.AutoFilter("Sheet1", "A1", "B", ""), newCellNameToCoordinatesError("B", newInvalidCellNameError("B")).Error()) } |