From 421f945f51f254054991127758db0520cf0f5456 Mon Sep 17 00:00:00 2001 From: xuri Date: Sat, 8 Jun 2019 00:00:55 +0800 Subject: Fixed #418, #420, #421, init adjust calculation chain support Update testing case --- adjust_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'adjust_test.go') 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")) +} -- cgit v1.2.1