@@ -224,7 +224,7 @@ func TestGetCellValue(t *testing.T) {
224224 f .checked = nil
225225 cells := []string {"A3" , "A4" , "B4" , "A7" , "B7" }
226226 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 )
228228 assert .NoError (t , err )
229229 for _ , cell := range cells {
230230 value , err := f .GetCellValue ("Sheet1" , cell )
@@ -246,21 +246,21 @@ func TestGetCellValue(t *testing.T) {
246246 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>` )))
247247 f .checked = nil
248248 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 )
250250 assert .NoError (t , err )
251251
252252 f .Sheet .Delete ("xl/worksheets/sheet1.xml" )
253253 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>` )))
254254 f .checked = nil
255255 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 )
257257 assert .NoError (t , err )
258258
259259 f .Sheet .Delete ("xl/worksheets/sheet1.xml" )
260260 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>` )))
261261 f .checked = nil
262262 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 )
264264 assert .NoError (t , err )
265265
266266 f .Sheet .Delete ("xl/worksheets/sheet1.xml" )
@@ -270,13 +270,13 @@ func TestGetCellValue(t *testing.T) {
270270 assert .Equal (t , "H6" , cell )
271271 assert .NoError (t , err )
272272 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" } },
275275 nil ,
276- {" 100" , "B3" },
277- {"" , "" , "" , "" , "" , "F4" },
276+ {Cell { Value : int64 ( 100 )}, Cell { Value : "B3" } },
277+ {Cell {}, Cell {}, Cell {}, Cell {}, Cell {}, Cell { Value : "F4" } },
278278 nil ,
279- {"" , "" , "" , "" , "" , "" , "" , "H6" },
279+ {Cell {}, Cell {}, Cell {}, Cell {}, Cell {}, Cell {}, Cell {}, Cell { Value : "H6" } },
280280 }, rows )
281281 assert .NoError (t , err )
282282
@@ -314,36 +314,36 @@ func TestGetCellValue(t *testing.T) {
314314</row>` )))
315315 f .checked = nil
316316 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" } ,
347347 }}, rows )
348348 assert .NoError (t , err )
349349}
0 commit comments