1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
12 var testDigit
= []rune
{
71 var testLetter
= []rune
{
106 func TestDigit(t
*testing
.T
) {
107 for _
, r
:= range testDigit
{
109 t
.Errorf("IsDigit(U+%04X) = false, want true", r
)
112 for _
, r
:= range testLetter
{
114 t
.Errorf("IsDigit(U+%04X) = true, want false", r
)
119 // Test that the special case in IsDigit agrees with the table
120 func TestDigitOptimization(t
*testing
.T
) {
121 for i
:= rune(0); i
<= MaxLatin1
; i
++ {
122 if Is(Digit
, i
) != IsDigit(i
) {
123 t
.Errorf("IsDigit(U+%04X) disagrees with Is(Digit)", i
)