From cd030d4aa81582e8bc04d029c0be6e42eff9ea47 Mon Sep 17 00:00:00 2001 From: xuri Date: Mon, 23 Aug 2021 00:15:43 +0800 Subject: Improve compatibility with row element with r="0" attribute --- cell_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'cell_test.go') diff --git a/cell_test.go b/cell_test.go index 91dc4fd..7a08560 100644 --- a/cell_test.go +++ b/cell_test.go @@ -225,6 +225,23 @@ func TestGetCellValue(t *testing.T) { rows, err = f.GetRows("Sheet1") assert.Equal(t, [][]string{{"A3"}, {"A4", "B4"}, nil, nil, nil, nil, {"A7", "B7"}, {"A8", "B8"}}, rows) assert.NoError(t, err) + + f.Sheet.Delete("xl/worksheets/sheet1.xml") + f.Pkg.Store("xl/worksheets/sheet1.xml", []byte(fmt.Sprintf(sheetData, `H6r0A6F4A6B6C6100B3`))) + f.checked = nil + cell, err = f.GetCellValue("Sheet1", "H6") + assert.Equal(t, "H6", cell) + assert.NoError(t, err) + rows, err = f.GetRows("Sheet1") + assert.Equal(t, [][]string{ + {"A6", "B6", "C6"}, + nil, + {"100", "B3"}, + {"", "", "", "", "", "F4"}, + nil, + {"", "", "", "", "", "", "", "H6"}, + }, rows) + assert.NoError(t, err) } func TestGetCellFormula(t *testing.T) { -- cgit v1.2.1