diff options
author | xuri <xuri.me@gmail.com> | 2019-06-08 00:00:55 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2019-06-08 00:00:55 +0800 |
commit | 421f945f51f254054991127758db0520cf0f5456 (patch) | |
tree | 9f8d0ae3c10a623d537ac3e84733e32feb9107b4 /adjust_test.go | |
parent | 3997dee1f58c81444733e1756da6138d4ce445f1 (diff) |
Fixed #418, #420, #421, init adjust calculation chain support
Update testing case
Diffstat (limited to 'adjust_test.go')
-rw-r--r-- | adjust_test.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/adjust_test.go b/adjust_test.go index 7b708ab..28432bc 100644 --- a/adjust_test.go +++ b/adjust_test.go @@ -67,3 +67,19 @@ func TestAdjustHelper(t *testing.T) { // testing adjustHelper on not exists worksheet. assert.EqualError(t, f.adjustHelper("SheetN", rows, 0, 0), "sheet SheetN is not exist") } + +func TestAdjustCalcChain(t *testing.T) { + f := NewFile() + f.CalcChain = &xlsxCalcChain{ + C: []xlsxCalcChainC{ + {R: "B2"}, + }, + } + assert.NoError(t, f.InsertCol("Sheet1", "A")) + assert.NoError(t, f.InsertRow("Sheet1", 1)) + + f.CalcChain.C[0].R = "invalid coordinates" + assert.EqualError(t, f.InsertCol("Sheet1", "A"), `cannot convert cell "invalid coordinates" to coordinates: invalid cell name "invalid coordinates"`) + f.CalcChain = nil + assert.NoError(t, f.InsertCol("Sheet1", "A")) +} |