summaryrefslogtreecommitdiff
path: root/adjust_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'adjust_test.go')
-rw-r--r--adjust_test.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/adjust_test.go b/adjust_test.go
index 3509b5d..7a482f7 100644
--- a/adjust_test.go
+++ b/adjust_test.go
@@ -17,7 +17,7 @@ func TestAdjustMergeCells(t *testing.T) {
},
},
},
- }, rows, 0, 0), `cannot convert cell "A" to coordinates: invalid cell name "A"`)
+ }, rows, 0, 0), newCellNameToCoordinatesError("A", newInvalidCellNameError("A")).Error())
assert.EqualError(t, f.adjustMergeCells(&xlsxWorksheet{
MergeCells: &xlsxMergeCells{
Cells: []*xlsxMergeCell{
@@ -26,7 +26,7 @@ func TestAdjustMergeCells(t *testing.T) {
},
},
},
- }, rows, 0, 0), `cannot convert cell "B" to coordinates: invalid cell name "B"`)
+ }, rows, 0, 0), newCellNameToCoordinatesError("B", newInvalidCellNameError("B")).Error())
assert.NoError(t, f.adjustMergeCells(&xlsxWorksheet{
MergeCells: &xlsxMergeCells{
Cells: []*xlsxMergeCell{
@@ -265,12 +265,12 @@ func TestAdjustAutoFilter(t *testing.T) {
AutoFilter: &xlsxAutoFilter{
Ref: "A:B1",
},
- }, rows, 0, 0), `cannot convert cell "A" to coordinates: invalid cell name "A"`)
+ }, rows, 0, 0), newCellNameToCoordinatesError("A", newInvalidCellNameError("A")).Error())
assert.EqualError(t, f.adjustAutoFilter(&xlsxWorksheet{
AutoFilter: &xlsxAutoFilter{
Ref: "A1:B",
},
- }, rows, 0, 0), `cannot convert cell "B" to coordinates: invalid cell name "B"`)
+ }, rows, 0, 0), newCellNameToCoordinatesError("B", newInvalidCellNameError("B")).Error())
}
func TestAdjustHelper(t *testing.T) {
@@ -281,8 +281,8 @@ func TestAdjustHelper(t *testing.T) {
f.Sheet.Store("xl/worksheets/sheet2.xml", &xlsxWorksheet{
AutoFilter: &xlsxAutoFilter{Ref: "A1:B"}})
// testing adjustHelper with illegal cell coordinates.
- assert.EqualError(t, f.adjustHelper("Sheet1", rows, 0, 0), `cannot convert cell "A" to coordinates: invalid cell name "A"`)
- assert.EqualError(t, f.adjustHelper("Sheet2", rows, 0, 0), `cannot convert cell "B" to coordinates: invalid cell name "B"`)
+ assert.EqualError(t, f.adjustHelper("Sheet1", rows, 0, 0), newCellNameToCoordinatesError("A", newInvalidCellNameError("A")).Error())
+ assert.EqualError(t, f.adjustHelper("Sheet2", rows, 0, 0), newCellNameToCoordinatesError("B", newInvalidCellNameError("B")).Error())
// testing adjustHelper on not exists worksheet.
assert.EqualError(t, f.adjustHelper("SheetN", rows, 0, 0), "sheet SheetN is not exist")
}
@@ -298,7 +298,7 @@ func TestAdjustCalcChain(t *testing.T) {
assert.NoError(t, f.InsertRow("Sheet1", 1))
f.CalcChain.C[1].R = "invalid coordinates"
- assert.EqualError(t, f.InsertCol("Sheet1", "A"), `cannot convert cell "invalid coordinates" to coordinates: invalid cell name "invalid coordinates"`)
+ assert.EqualError(t, f.InsertCol("Sheet1", "A"), newCellNameToCoordinatesError("invalid coordinates", newInvalidCellNameError("invalid coordinates")).Error())
f.CalcChain = nil
assert.NoError(t, f.InsertCol("Sheet1", "A"))
}