@@ -224,11 +224,11 @@ func TestGetCellValue(t *testing.T) {
224
224
f .checked = nil
225
225
cells := []string {"A3" , "A4" , "B4" , "A7" , "B7" }
226
226
rows , err := f .GetRows ("Sheet1" )
227
- assert .Equal (t , [][]string {nil , nil , {"A3" }, {"A4" , "B4" }, nil , nil , {"A7" , "B7" }, {"A8" , "B8" }}, rows )
227
+ assert .Equal (t , [][]Cell {nil , nil , {Cell { Value : "A3" }} , {Cell { Value : "A4" }, Cell { Value : "B4" }} , nil , nil , {Cell { Value : "A7" }, Cell { Value : "B7" }} , {Cell { Value : "A8" }, Cell { Value : "B8" } }}, rows )
228
228
assert .NoError (t , err )
229
229
for _ , cell := range cells {
230
230
value , err := f .GetCellValue ("Sheet1" , cell )
231
- assert .Equal (t , cell , value )
231
+ assert .Equal (t , cell , value )
232
232
assert .NoError (t , err )
233
233
}
234
234
cols , err := f .GetCols ("Sheet1" )
@@ -239,44 +239,44 @@ func TestGetCellValue(t *testing.T) {
239
239
f .Pkg .Store ("xl/worksheets/sheet1.xml" , []byte (fmt .Sprintf (sheetData , `<row r="2"><c r="A2" t="str"><v>A2</v></c></row><row r="2"><c r="B2" t="str"><v>B2</v></c></row>` )))
240
240
f .checked = nil
241
241
cell , err := f .GetCellValue ("Sheet1" , "A2" )
242
- assert .Equal (t , "A2" , cell )
242
+ assert .Equal (t , "A2" , cell )
243
243
assert .NoError (t , err )
244
244
245
245
f .Sheet .Delete ("xl/worksheets/sheet1.xml" )
246
246
f .Pkg .Store ("xl/worksheets/sheet1.xml" , []byte (fmt .Sprintf (sheetData , `<row r="2"><c r="A2" t="str"><v>A2</v></c></row><row r="2"><c r="B2" t="str"><v>B2</v></c></row>` )))
247
247
f .checked = nil
248
248
rows , err = f .GetRows ("Sheet1" )
249
- assert .Equal (t , [][]string {nil , {"A2" , "B2" }}, rows )
249
+ assert .Equal (t , [][]Cell {nil , {Cell { Value : "A2" }, Cell { Value : "B2" } }}, rows )
250
250
assert .NoError (t , err )
251
251
252
252
f .Sheet .Delete ("xl/worksheets/sheet1.xml" )
253
253
f .Pkg .Store ("xl/worksheets/sheet1.xml" , []byte (fmt .Sprintf (sheetData , `<row r="1"><c r="A1" t="str"><v>A1</v></c></row><row r="1"><c r="B1" t="str"><v>B1</v></c></row>` )))
254
254
f .checked = nil
255
255
rows , err = f .GetRows ("Sheet1" )
256
- assert .Equal (t , [][]string {{ "A1" , "B1" }}, rows )
256
+ assert .Equal (t , [][]Cell {{ Cell { Value : "A1" }, Cell { Value : "B1" } }}, rows )
257
257
assert .NoError (t , err )
258
258
259
259
f .Sheet .Delete ("xl/worksheets/sheet1.xml" )
260
260
f .Pkg .Store ("xl/worksheets/sheet1.xml" , []byte (fmt .Sprintf (sheetData , `<row><c t="str"><v>A3</v></c></row><row><c t="str"><v>A4</v></c><c t="str"><v>B4</v></c></row><row r="7"><c t="str"><v>A7</v></c><c t="str"><v>B7</v></c></row><row><c t="str"><v>A8</v></c><c t="str"><v>B8</v></c></row>` )))
261
261
f .checked = nil
262
262
rows , err = f .GetRows ("Sheet1" )
263
- assert .Equal (t , [][]string {{ "A3" }, {"A4" , "B4" }, nil , nil , nil , nil , {"A7" , "B7" }, {"A8" , "B8" }}, rows )
263
+ assert .Equal (t , [][]Cell {{ Cell { Value : "A3" }} , {Cell { Value : "A4" }, Cell { Value : "B4" }} , nil , nil , nil , nil , {Cell { Value : "A7" }, Cell { Value : "B7" }} , {Cell { Value : "A8" }, Cell { Value : "B8" } }}, rows )
264
264
assert .NoError (t , err )
265
265
266
266
f .Sheet .Delete ("xl/worksheets/sheet1.xml" )
267
267
f .Pkg .Store ("xl/worksheets/sheet1.xml" , []byte (fmt .Sprintf (sheetData , `<row r="0"><c r="H6" t="str"><v>H6</v></c><c r="A1" t="str"><v>r0A6</v></c><c r="F4" t="str"><v>F4</v></c></row><row><c r="A1" t="str"><v>A6</v></c><c r="B1" t="str"><v>B6</v></c><c r="C1" t="str"><v>C6</v></c></row><row r="3"><c r="A3"><v>100</v></c><c r="B3" t="str"><v>B3</v></c></row>` )))
268
268
f .checked = nil
269
269
cell , err = f .GetCellValue ("Sheet1" , "H6" )
270
- assert .Equal (t , "H6" , cell )
270
+ assert .Equal (t , "H6" , cell )
271
271
assert .NoError (t , err )
272
272
rows , err = f .GetRows ("Sheet1" )
273
- assert .Equal (t , [][]string {
274
- { "A6" , "B6" , "C6" },
273
+ assert .Equal (t , [][]Cell {
274
+ { Cell { Value : "A6" }, Cell { Value : "B6" }, Cell { Value : "C6" } },
275
275
nil ,
276
- { " 100" , "B3" },
277
- { "" , "" , "" , "" , "" , "F4" },
276
+ { Cell { Value : int64 ( 100 )}, Cell { Value : "B3" } },
277
+ { Cell {}, Cell {}, Cell {}, Cell {}, Cell {}, Cell { Value : "F4" } },
278
278
nil ,
279
- { "" , "" , "" , "" , "" , "" , "" , "H6" },
279
+ { Cell {}, Cell {}, Cell {}, Cell {}, Cell {}, Cell {}, Cell {}, Cell { Value : "H6" } },
280
280
}, rows )
281
281
assert .NoError (t , err )
282
282
@@ -314,36 +314,36 @@ func TestGetCellValue(t *testing.T) {
314
314
</row>` )))
315
315
f .checked = nil
316
316
rows , err = f .GetRows ("Sheet1" )
317
- assert .Equal (t , [][]string {{
318
- " 2422.3" ,
319
- " 2422.3" ,
320
- " 12.4" ,
321
- " 964" ,
322
- " 1101.6" ,
323
- " 275.4" ,
324
- " 68.9" ,
325
- " 44385.2083333333" ,
326
- " 5.1" ,
327
- " 5.11" ,
328
- " 5.1" ,
329
- " 5.111" ,
330
- " 5.1111" ,
331
- " 2422.012345678" ,
332
- " 2422.0123456789" ,
333
- " 12.012345678901" ,
334
- " 964" ,
335
- " 1101.6" ,
336
- " 275.4" ,
337
- " 68.9" ,
338
- " 0.08888" ,
339
- " 0.00004" ,
340
- " 2422.3" ,
341
- " 1101.6" ,
342
- " 275.4" ,
343
- " 68.9" ,
344
- " 1.1" ,
345
- "1234567890123_4" ,
346
- "123456789_0123_4" ,
317
+ assert .Equal (t , [][]Cell {{
318
+ Cell { Value : 2422.3 } ,
319
+ Cell { Value : 2422.3 } ,
320
+ Cell { Value : 12.4 } ,
321
+ Cell { Value : int64 ( 964 )} ,
322
+ Cell { Value : 1101.6 } ,
323
+ Cell { Value : 275.4 } ,
324
+ Cell { Value : 68.9 } ,
325
+ Cell { Value : 44385.2083333333 } ,
326
+ Cell { Value : 5.1 } ,
327
+ Cell { Value : 5.11 } ,
328
+ Cell { Value : 5.1 } ,
329
+ Cell { Value : 5.111 } ,
330
+ Cell { Value : 5.1111 } ,
331
+ Cell { Value : 2422.012345678 } ,
332
+ Cell { Value : 2422.0123456789 } ,
333
+ Cell { Value : 12.012345678901 } ,
334
+ Cell { Value : int64 ( 964 )} ,
335
+ Cell { Value : 1101.6 } ,
336
+ Cell { Value : 275.4 } ,
337
+ Cell { Value : 68.9 } ,
338
+ Cell { Value : 0.08888 } ,
339
+ Cell { Value : 0.00004 } ,
340
+ Cell { Value : 2422.3 } ,
341
+ Cell { Value : 1101.6 } ,
342
+ Cell { Value : 275.4 } ,
343
+ Cell { Value : 68.9 } ,
344
+ Cell { Value : 1.1 } ,
345
+ Cell { Value : "1234567890123_4" } ,
346
+ Cell { Value : "123456789_0123_4" } ,
347
347
}}, rows )
348
348
assert .NoError (t , err )
349
349
}
0 commit comments