diff options
author | xuri <xuri.me@gmail.com> | 2020-05-29 00:26:40 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2020-05-29 00:26:40 +0800 |
commit | 2ae631376b95ff0a59ea18c2c0befcd50135b020 (patch) | |
tree | c3542c127aed38cac104c513047327d6316b91d1 /lib_test.go | |
parent | c168233e70db8f220bd07d9d6d277ae9e2a4a73f (diff) |
add limits for total columns, row and filename length
Diffstat (limited to 'lib_test.go')
-rw-r--r-- | lib_test.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib_test.go b/lib_test.go index 0e717b2..229412c 100644 --- a/lib_test.go +++ b/lib_test.go @@ -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) { |