|
|
|
@ -23,7 +23,6 @@ var validColumns = []struct {
|
|
|
|
|
{Name: "AZ", Num: 26 + 26},
|
|
|
|
|
{Name: "ZZ", Num: 26 + 26*26},
|
|
|
|
|
{Name: "AAA", Num: 26 + 26*26 + 1},
|
|
|
|
|
{Name: "ZZZ", Num: 26 + 26*26 + 26*26*26},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var invalidColumns = []struct {
|
|
|
|
@ -72,6 +71,8 @@ func TestColumnNameToNumber_Error(t *testing.T) {
|
|
|
|
|
assert.Equalf(t, col.Num, out, msg, col.Name)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
_, err := ColumnNameToNumber("XFE")
|
|
|
|
|
assert.EqualError(t, err, "column number exceeds maximum limit")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestColumnNumberToName_OK(t *testing.T) {
|
|
|
|
@ -172,6 +173,8 @@ func TestCellNameToCoordinates_Error(t *testing.T) {
|
|
|
|
|
assert.Equalf(t, -1, r, msg, cell)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
_, _, err := CellNameToCoordinates("A1048577")
|
|
|
|
|
assert.EqualError(t, err, "row number exceeds maximum limit")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestCoordinatesToCellName_OK(t *testing.T) {
|
|
|
|
|