go-opengl-pixel/text/atlas_test.go

25 lines
468 B
Go
Raw Normal View History

2018-01-19 16:09:48 -06:00
package text_test
2018-01-19 16:09:48 -06:00
import (
"testing"
"github.com/faiface/pixel/text"
)
func TestAtlas7x13(t *testing.T) {
2018-01-19 16:09:48 -06:00
if text.Atlas7x13 == nil {
t.Fatalf("Atlas7x13 is nil")
}
for _, tt := range []struct {
runes []rune
want bool
2018-01-19 16:09:48 -06:00
}{{text.ASCII, true}, {[]rune("ÅÄÖ"), false}} {
for _, r := range tt.runes {
2018-01-19 16:09:48 -06:00
if got := text.Atlas7x13.Contains(r); got != tt.want {
t.Fatalf("Atlas7x13.Contains('%s') = %v, want %v", string(r), got, tt.want)
}
}
}
}