File: makefont_test.go

package info (click to toggle)
golang-github-jung-kurt-gofpdf 2.17.2%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 2,368 kB
  • sloc: makefile: 51; awk: 7
file content (26 lines) | stat: -rw-r--r-- 616 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package main

import (
	"os/exec"
	"strings"
	"testing"
)

func TestMakefont(t *testing.T) {
	var out []byte
	var err error
	const expect = "Font definition file successfully generated"
	// Make sure makefont utility has been built before generating font definition file
	err = exec.Command("go", "build").Run()
	if err != nil {
		t.Fatal(err)
	}
	out, err = exec.Command("./makefont", "--dst=../font", "--embed",
		"--enc=../font/cp1252.map", "../font/calligra.ttf").CombinedOutput()
	if err != nil {
		t.Fatal(err)
	}
	if !strings.Contains(string(out), expect) {
		t.Fatalf("Unexpected output from makefont")
	}
}