diff options
author | xuri <xuri.me@gmail.com> | 2021-07-05 00:03:56 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2021-07-05 00:03:56 +0800 |
commit | 544ef18a8cb9949fcb8833c6d2816783c90f3318 (patch) | |
tree | 88bb3eaa9d92522d3b5c4eeb052210c26bc4c99f /chart_test.go | |
parent | 0e02329bedf6648259fd219642bb907bdb07fd21 (diff) |
- Support concurrency iterate rows and columns
- Rename exported field `File.XLSX` to `File.Pkg`
- Exported error message
Diffstat (limited to 'chart_test.go')
-rw-r--r-- | chart_test.go | 14 |
1 files changed, 9 insertions, 5 deletions
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]) |