Test the kind of error

This commit is contained in:
Daniele Tricoli 2015-11-22 19:27:23 +01:00
parent 473189b745
commit 593de41093

View file

@ -1,5 +1,6 @@
package format // import "eriol.xyz/piken/format"
import (
"strconv"
"testing"
"github.com/stretchr/testify/assert"
@ -12,5 +13,7 @@ func TestCodePointToGlyph(t *testing.T) {
glyph, err = CodePointToGlyph("1000000000")
assert.Equal(t, glyph, "")
assert.Error(t, err)
if assert.Error(t, err) {
assert.Equal(t, err.(*strconv.NumError).Err, strconv.ErrRange)
}
}