From f0cb29cf6668ab96992b1e48278d9f5b1f9e4976 Mon Sep 17 00:00:00 2001 From: xuri Date: Sat, 5 Mar 2022 14:48:34 +0800 Subject: This closes #1162, improve the compatibility with alternate content Preserve alternate content in the workbook, worksheet, and drawingML --- rows_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'rows_test.go') diff --git a/rows_test.go b/rows_test.go index 1286a37..208b2de 100644 --- a/rows_test.go +++ b/rows_test.go @@ -2,6 +2,7 @@ package excelize import ( "bytes" + "encoding/xml" "fmt" "path/filepath" "testing" @@ -901,12 +902,12 @@ func TestErrSheetNotExistError(t *testing.T) { func TestCheckRow(t *testing.T) { f := NewFile() - f.Pkg.Store("xl/worksheets/sheet1.xml", []byte(`12345`)) + f.Pkg.Store("xl/worksheets/sheet1.xml", []byte(xml.Header+`12345`)) _, err := f.GetRows("Sheet1") assert.NoError(t, err) assert.NoError(t, f.SetCellValue("Sheet1", "A1", false)) f = NewFile() - f.Pkg.Store("xl/worksheets/sheet1.xml", []byte(`12345`)) + f.Pkg.Store("xl/worksheets/sheet1.xml", []byte(xml.Header+`12345`)) f.Sheet.Delete("xl/worksheets/sheet1.xml") delete(f.checked, "xl/worksheets/sheet1.xml") assert.EqualError(t, f.SetCellValue("Sheet1", "A1", false), newCellNameToCoordinatesError("-", newInvalidCellNameError("-")).Error()) -- cgit v1.2.1