package badge import ( "html/template" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestParseBadgeTemplate(t *testing.T) { raw, err := assets.ReadFile("badge.svg.tpl") require.NoError(t, err) _, err = template.New("svg").Parse(string(raw)) require.NoError(t, err) } func TestRenderBadge(t *testing.T) { badge := Create("golang", "test", "green") assert.Equal(t, []byte(`golanggolangtesttest`), badge) }