test: fix test

This commit is contained in:
vicanso 2022-02-19 09:26:11 +08:00
parent 9763d48eef
commit 7ea306b7f4
4 changed files with 12 additions and 7 deletions

View file

@ -165,7 +165,8 @@ func TestEChartsPadding(t *testing.T) {
ep := EChartsPadding{}
ep.UnmarshalJSON([]byte(`10`))
err := ep.UnmarshalJSON([]byte(`10`))
assert.Nil(err)
assert.Equal(EChartsPadding{
Box: chart.Box{
Top: 10,
@ -176,7 +177,8 @@ func TestEChartsPadding(t *testing.T) {
}, ep)
ep = EChartsPadding{}
ep.UnmarshalJSON([]byte(`[10, 20]`))
err = ep.UnmarshalJSON([]byte(`[10, 20]`))
assert.Nil(err)
assert.Equal(EChartsPadding{
Box: chart.Box{
Top: 10,
@ -187,7 +189,8 @@ func TestEChartsPadding(t *testing.T) {
}, ep)
ep = EChartsPadding{}
ep.UnmarshalJSON([]byte(`[10, 20, 30]`))
err = ep.UnmarshalJSON([]byte(`[10, 20, 30]`))
assert.Nil(err)
assert.Equal(EChartsPadding{
Box: chart.Box{
Top: 10,
@ -198,7 +201,8 @@ func TestEChartsPadding(t *testing.T) {
}, ep)
ep = EChartsPadding{}
ep.UnmarshalJSON([]byte(`[10, 20, 30, 40]`))
err = ep.UnmarshalJSON([]byte(`[10, 20, 30, 40]`))
assert.Nil(err)
assert.Equal(EChartsPadding{
Box: chart.Box{
Top: 10,