@@ -31,9 +31,12 @@ func TestOpenFile(t *testing.T) {
31
31
xlsx .UpdateLinkedValue ()
32
32
xlsx .SetCellDefault ("Sheet2" , "A1" , strconv .FormatFloat (float64 (100.1588 ), 'f' , - 1 , 32 ))
33
33
xlsx .SetCellDefault ("Sheet2" , "A1" , strconv .FormatFloat (float64 (- 100.1588 ), 'f' , - 1 , 64 ))
34
+ // Test set cell value with illegal row number.
35
+ xlsx .SetCellDefault ("Sheet2" , "A" , strconv .FormatFloat (float64 (- 100.1588 ), 'f' , - 1 , 64 ))
34
36
xlsx .SetCellInt ("Sheet2" , "A1" , 100 )
37
+ // Test set cell integer value with illegal row number.
38
+ xlsx .SetCellInt ("Sheet2" , "A" , 100 )
35
39
xlsx .SetCellStr ("Sheet2" , "C11" , "Knowns" )
36
-
37
40
// Test max characters in a cell.
38
41
xlsx .SetCellStr ("Sheet2" , "D11" , strings .Repeat ("c" , 32769 ))
39
42
xlsx .NewSheet (":\\ /?*[]Maximum 31 characters allowed in sheet title." )
@@ -42,12 +45,19 @@ func TestOpenFile(t *testing.T) {
42
45
xlsx .SetCellInt ("Sheet3" , "A23" , 10 )
43
46
xlsx .SetCellStr ("Sheet3" , "b230" , "10" )
44
47
xlsx .SetCellStr ("Sheet10" , "b230" , "10" )
48
+ // Test set cell string value with illegal row number.
49
+ xlsx .SetCellStr ("Sheet10" , "A" , "10" )
45
50
xlsx .SetActiveSheet (2 )
46
- xlsx .GetCellFormula ("Sheet1" , "B19" ) // Test get cell formula with given rows number.
47
- xlsx .GetCellFormula ("Sheet2" , "B20" ) // Test get cell formula with illegal worksheet index.
48
- xlsx .GetCellFormula ("Sheet1" , "B20" ) // Test get cell formula with illegal rows number.
51
+ // Test get cell formula with given rows number.
52
+ xlsx .GetCellFormula ("Sheet1" , "B19" )
53
+ // Test get cell formula with illegal worksheet index.
54
+ xlsx .GetCellFormula ("Sheet2" , "B20" )
55
+ // Test get cell formula with illegal rows number.
56
+ xlsx .GetCellFormula ("Sheet1" , "B20" )
57
+ xlsx .GetCellFormula ("Sheet1" , "B" )
49
58
// Test read cell value with given illegal rows number.
50
59
xlsx .GetCellValue ("Sheet2" , "a-1" )
60
+ xlsx .GetCellValue ("Sheet2" , "A" )
51
61
// Test read cell value with given lowercase column number.
52
62
xlsx .GetCellValue ("Sheet2" , "a5" )
53
63
xlsx .GetCellValue ("Sheet2" , "C11" )
@@ -245,6 +255,8 @@ func TestSetCellFormula(t *testing.T) {
245
255
}
246
256
xlsx .SetCellFormula ("Sheet1" , "B19" , "SUM(Sheet2!D2,Sheet2!D11)" )
247
257
xlsx .SetCellFormula ("Sheet1" , "C19" , "SUM(Sheet2!D2,Sheet2!D9)" )
258
+ // Test set cell formula with illegal rows number.
259
+ xlsx .SetCellFormula ("Sheet1" , "C" , "SUM(Sheet2!D2,Sheet2!D9)" )
248
260
err = xlsx .Save ()
249
261
if err != nil {
250
262
t .Log (err )
@@ -315,6 +327,11 @@ func TestSetCellStyleAlignment(t *testing.T) {
315
327
t .Log (err )
316
328
}
317
329
xlsx .SetCellStyle ("Sheet1" , "A22" , "A22" , style )
330
+ // Test set cell style with given illegal rows number.
331
+ xlsx .SetCellStyle ("Sheet1" , "A" , "A22" , style )
332
+ xlsx .SetCellStyle ("Sheet1" , "A22" , "A" , style )
333
+ // Test get cell style with given illegal rows number.
334
+ xlsx .GetCellStyle ("Sheet1" , "A" )
318
335
err = xlsx .Save ()
319
336
if err != nil {
320
337
t .Log (err )
0 commit comments