2018-01-19 16:09:48 -06:00
|
|
|
package text_test
|
2018-01-19 15:20:54 -06:00
|
|
|
|
2018-01-19 16:09:48 -06:00
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/faiface/pixel/text"
|
|
|
|
)
|
2018-01-19 15:20:54 -06:00
|
|
|
|
|
|
|
func TestAtlas7x13(t *testing.T) {
|
2018-01-19 16:09:48 -06:00
|
|
|
if text.Atlas7x13 == nil {
|
2018-01-19 15:20:54 -06:00
|
|
|
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}} {
|
2018-01-19 15:20:54 -06:00
|
|
|
for _, r := range tt.runes {
|
2018-01-19 16:09:48 -06:00
|
|
|
if got := text.Atlas7x13.Contains(r); got != tt.want {
|
2018-01-19 15:20:54 -06:00
|
|
|
t.Fatalf("Atlas7x13.Contains('%s') = %v, want %v", string(r), got, tt.want)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|