1 // Copyright 2011 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 // Independently check that the special "Is" functions work
13 // in the Latin-1 range through the property table.
15 func TestIsControlLatin1(t
*testing
.T
) {
16 for i
:= rune(0); i
<= MaxLatin1
; i
++ {
20 case 0x00 <= i
&& i
<= 0x1F:
22 case 0x7F <= i
&& i
<= 0x9F:
26 t
.Errorf("%U incorrect: got %t; want %t", i
, got
, want
)
31 func TestIsLetterLatin1(t
*testing
.T
) {
32 for i
:= rune(0); i
<= MaxLatin1
; i
++ {
36 t
.Errorf("%U incorrect: got %t; want %t", i
, got
, want
)
41 func TestIsUpperLatin1(t
*testing
.T
) {
42 for i
:= rune(0); i
<= MaxLatin1
; i
++ {
46 t
.Errorf("%U incorrect: got %t; want %t", i
, got
, want
)
51 func TestIsLowerLatin1(t
*testing
.T
) {
52 for i
:= rune(0); i
<= MaxLatin1
; i
++ {
56 t
.Errorf("%U incorrect: got %t; want %t", i
, got
, want
)
61 func TestNumberLatin1(t
*testing
.T
) {
62 for i
:= rune(0); i
<= MaxLatin1
; i
++ {
66 t
.Errorf("%U incorrect: got %t; want %t", i
, got
, want
)
71 func TestIsPrintLatin1(t
*testing
.T
) {
72 for i
:= rune(0); i
<= MaxLatin1
; i
++ {
74 want
:= In(i
, PrintRanges
...)
79 t
.Errorf("%U incorrect: got %t; want %t", i
, got
, want
)
84 func TestIsGraphicLatin1(t
*testing
.T
) {
85 for i
:= rune(0); i
<= MaxLatin1
; i
++ {
87 want
:= In(i
, GraphicRanges
...)
89 t
.Errorf("%U incorrect: got %t; want %t", i
, got
, want
)
94 func TestIsPunctLatin1(t
*testing
.T
) {
95 for i
:= rune(0); i
<= MaxLatin1
; i
++ {
99 t
.Errorf("%U incorrect: got %t; want %t", i
, got
, want
)
104 func TestIsSpaceLatin1(t
*testing
.T
) {
105 for i
:= rune(0); i
<= MaxLatin1
; i
++ {
107 want
:= Is(White_Space
, i
)
109 t
.Errorf("%U incorrect: got %t; want %t", i
, got
, want
)
114 func TestIsSymbolLatin1(t
*testing
.T
) {
115 for i
:= rune(0); i
<= MaxLatin1
; i
++ {
117 want
:= Is(Symbol
, i
)
119 t
.Errorf("%U incorrect: got %t; want %t", i
, got
, want
)