diff --git a/title_test.go b/title_test.go index b5928eb..9556d9c 100644 --- a/title_test.go +++ b/title_test.go @@ -23,6 +23,7 @@ package charts import ( + "fmt" "testing" "github.com/stretchr/testify/assert" @@ -113,6 +114,20 @@ func TestDrawTitle(t *testing.T) { Bottom: 68, }, }, + { + newDraw: newDraw, + newOption: func() *TitleOption { + opt := newOption() + opt.Left = "10%" + opt.Top = "10" + return opt + }, + result: "\\ntitleHellosubtitleWorld!", + box: chart.Box{ + Right: 83, + Bottom: 68, + }, + }, } for _, tt := range tests { d := tt.newDraw() @@ -123,6 +138,7 @@ func TestDrawTitle(t *testing.T) { data, err := d.Bytes() assert.Nil(err) assert.NotEmpty(data) + fmt.Println(string(data)) assert.Equal(tt.result, string(data)) } }