From 544ef18a8cb9949fcb8833c6d2816783c90f3318 Mon Sep 17 00:00:00 2001 From: xuri Date: Mon, 5 Jul 2021 00:03:56 +0800 Subject: - Support concurrency iterate rows and columns - Rename exported field `File.XLSX` to `File.Pkg` - Exported error message --- chart_test.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'chart_test.go') diff --git a/chart_test.go b/chart_test.go index 657230b..8957b93 100644 --- a/chart_test.go +++ b/chart_test.go @@ -65,10 +65,10 @@ func TestChartSize(t *testing.T) { anchor decodeTwoCellAnchor ) - content, ok := newFile.XLSX["xl/drawings/drawing1.xml"] + content, ok := newFile.Pkg.Load("xl/drawings/drawing1.xml") assert.True(t, ok, "Can't open the chart") - err = xml.Unmarshal([]byte(content), &workdir) + err = xml.Unmarshal(content.([]byte), &workdir) if !assert.NoError(t, err) { t.FailNow() } @@ -340,11 +340,15 @@ func TestChartWithLogarithmicBase(t *testing.T) { type xmlChartContent []byte xmlCharts := make([]xmlChartContent, expectedChartsCount) expectedChartsLogBase := []float64{0, 10.5, 0, 2, 0, 1000} - var ok bool - + var ( + drawingML interface{} + ok bool + ) for i := 0; i < expectedChartsCount; i++ { chartPath := fmt.Sprintf("xl/charts/chart%d.xml", i+1) - xmlCharts[i], ok = newFile.XLSX[chartPath] + if drawingML, ok = newFile.Pkg.Load(chartPath); ok { + xmlCharts[i] = drawingML.([]byte) + } assert.True(t, ok, "Can't open the %s", chartPath) err = xml.Unmarshal([]byte(xmlCharts[i]), &chartSpaces[i]) -- cgit v1.2.1