re PR tree-optimization/79007 (gcc.dg/tree-ssa/dse-points-to.c fails starting with...
[official-gcc.git] / libgo / go / unicode / graphic_test.go
blobc9f289c7f55cb6654b2270152cee2fdf77c1ff06
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.
5 package unicode_test
7 import (
8 "testing"
9 . "unicode"
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++ {
17 got := IsControl(i)
18 want := false
19 switch {
20 case 0x00 <= i && i <= 0x1F:
21 want = true
22 case 0x7F <= i && i <= 0x9F:
23 want = true
25 if got != want {
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++ {
33 got := IsLetter(i)
34 want := Is(Letter, i)
35 if got != want {
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++ {
43 got := IsUpper(i)
44 want := Is(Upper, i)
45 if got != want {
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++ {
53 got := IsLower(i)
54 want := Is(Lower, i)
55 if got != want {
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++ {
63 got := IsNumber(i)
64 want := Is(Number, i)
65 if got != want {
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++ {
73 got := IsPrint(i)
74 want := In(i, PrintRanges...)
75 if i == ' ' {
76 want = true
78 if got != want {
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++ {
86 got := IsGraphic(i)
87 want := In(i, GraphicRanges...)
88 if got != want {
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++ {
96 got := IsPunct(i)
97 want := Is(Punct, i)
98 if got != want {
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++ {
106 got := IsSpace(i)
107 want := Is(White_Space, i)
108 if got != want {
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++ {
116 got := IsSymbol(i)
117 want := Is(Symbol, i)
118 if got != want {
119 t.Errorf("%U incorrect: got %t; want %t", i, got, want)