test: fix test
This commit is contained in:
parent
bff06b2aa5
commit
1c89ed29be
6 changed files with 152 additions and 53 deletions
34
draw_test.go
34
draw_test.go
|
|
@ -90,6 +90,40 @@ func TestWidthHeightOption(t *testing.T) {
|
|||
}, d.Box)
|
||||
}
|
||||
|
||||
func TestBoxOption(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
d, err := NewDraw(DrawOption{
|
||||
Width: 400,
|
||||
Height: 300,
|
||||
})
|
||||
assert.Nil(err)
|
||||
|
||||
err = BoxOption(chart.Box{
|
||||
Left: 10,
|
||||
Top: 20,
|
||||
Right: 50,
|
||||
Bottom: 100,
|
||||
})(d)
|
||||
assert.Nil(err)
|
||||
assert.Equal(chart.Box{
|
||||
Left: 10,
|
||||
Top: 20,
|
||||
Right: 50,
|
||||
Bottom: 100,
|
||||
}, d.Box)
|
||||
|
||||
// zero box will be ignored
|
||||
err = BoxOption(chart.Box{})(d)
|
||||
assert.Nil(err)
|
||||
assert.Equal(chart.Box{
|
||||
Left: 10,
|
||||
Top: 20,
|
||||
Right: 50,
|
||||
Bottom: 100,
|
||||
}, d.Box)
|
||||
}
|
||||
|
||||
func TestPaddingOption(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue