OLD | NEW |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 package unicode_test | 5 package unicode_test |
6 | 6 |
7 import ( | 7 import ( |
8 "testing" | 8 "testing" |
9 . "unicode" | 9 . "unicode" |
10 ) | 10 ) |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 } | 111 } |
112 for _, r := range testLetter { | 112 for _, r := range testLetter { |
113 if IsDigit(r) { | 113 if IsDigit(r) { |
114 t.Errorf("IsDigit(U+%04X) = true, want false", r) | 114 t.Errorf("IsDigit(U+%04X) = true, want false", r) |
115 } | 115 } |
116 } | 116 } |
117 } | 117 } |
118 | 118 |
119 // Test that the special case in IsDigit agrees with the table | 119 // Test that the special case in IsDigit agrees with the table |
120 func TestDigitOptimization(t *testing.T) { | 120 func TestDigitOptimization(t *testing.T) { |
121 » for i := 0; i < Latin1Max; i++ { | 121 » for i := 0; i <= MaxLatin1; i++ { |
122 if Is(Digit, i) != IsDigit(i) { | 122 if Is(Digit, i) != IsDigit(i) { |
123 t.Errorf("IsDigit(U+%04X) disagrees with Is(Digit)", i) | 123 t.Errorf("IsDigit(U+%04X) disagrees with Is(Digit)", i) |
124 } | 124 } |
125 } | 125 } |
126 } | 126 } |
OLD | NEW |