Add tests for CodePointToGlyph
This commit is contained in:
parent
a8a1a825ec
commit
473189b745
|
@ -0,0 +1,16 @@
|
||||||
|
package format // import "eriol.xyz/piken/format"
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestCodePointToGlyph(t *testing.T) {
|
||||||
|
glyph, err := CodePointToGlyph("1F602")
|
||||||
|
assert.Nil(t, err)
|
||||||
|
assert.Equal(t, glyph, "😂")
|
||||||
|
|
||||||
|
glyph, err = CodePointToGlyph("1000000000")
|
||||||
|
assert.Equal(t, glyph, "")
|
||||||
|
assert.Error(t, err)
|
||||||
|
}
|
Loading…
Reference in New Issue