test
This commit is contained in:
parent
9872f2e6a9
commit
705f4a4845
2 changed files with 21 additions and 0 deletions
21
d2renderers/d2fonts/d2fonts_test.go
Normal file
21
d2renderers/d2fonts/d2fonts_test.go
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
package d2fonts
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/jung-kurt/gofpdf"
|
||||
"oss.terrastruct.com/util-go/assert"
|
||||
"oss.terrastruct.com/util-go/diff"
|
||||
)
|
||||
|
||||
func TestCutFont(t *testing.T) {
|
||||
f := Font{
|
||||
Family: SourceCodePro,
|
||||
Style: FONT_STYLE_REGULAR,
|
||||
}
|
||||
fontBuf := FontFaces[f]
|
||||
fontBuf = gofpdf.UTF8CutFont(fontBuf, "a")
|
||||
err := diff.Testdata(filepath.Join("testdata", "d2fonts", "cut"), ".txt", fontBuf)
|
||||
assert.Success(t, err)
|
||||
}
|
||||
BIN
d2renderers/d2fonts/testdata/d2fonts/cut.exp.txt
vendored
Normal file
BIN
d2renderers/d2fonts/testdata/d2fonts/cut.exp.txt
vendored
Normal file
Binary file not shown.
Loading…
Reference in a new issue