Test the kind of error
This commit is contained in:
parent
473189b745
commit
593de41093
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue