1
0
mirror of https://github.com/golang/go synced 2024-11-22 06:04:39 -07:00

unicode: update to unicode 6.0.0

R=rsc
CC=golang-dev
https://golang.org/cl/3981049
This commit is contained in:
Rob Pike 2011-01-31 15:20:44 -08:00
parent 614391860a
commit fc52d7029f
4 changed files with 312 additions and 191 deletions

View File

@ -56,6 +56,7 @@ var letterTest = []int{
0xf9, 0xf9,
0x2ec, 0x2ec,
0x535, 0x535,
0x620,
0x6e6, 0x6e6,
0x93d, 0x93d,
0xa15, 0xa15,
@ -85,7 +86,7 @@ var notletterTest = []int{
0x20, 0x20,
0x35, 0x35,
0x375, 0x375,
0x620, 0x619,
0x700, 0x700,
0xfffe, 0xfffe,
0x1ffff, 0x1ffff,

View File

@ -32,7 +32,7 @@ func main() {
var dataURL = flag.String("data", "", "full URL for UnicodeData.txt; defaults to --url/UnicodeData.txt") var dataURL = flag.String("data", "", "full URL for UnicodeData.txt; defaults to --url/UnicodeData.txt")
var url = flag.String("url", var url = flag.String("url",
"http://www.unicode.org/Public/5.2.0/ucd/", "http://www.unicode.org/Public/6.0.0/ucd/",
"URL of Unicode database directory") "URL of Unicode database directory")
var tablelist = flag.String("tables", var tablelist = flag.String("tables",
"all", "all",
@ -382,7 +382,7 @@ func printCategories() {
type Op func(code int) bool type Op func(code int) bool
const format = "\tRange{0x%04x, 0x%04x, %d},\n" const format = "\t{0x%04x, 0x%04x, %d},\n"
func dumpRange(header string, inCategory Op) { func dumpRange(header string, inCategory Op) {
fmt.Print(header) fmt.Print(header)
@ -805,14 +805,14 @@ func printCaseRange(lo, hi *caseState) {
} }
switch { switch {
case hi.point > lo.point && lo.isUpperLower(): case hi.point > lo.point && lo.isUpperLower():
fmt.Printf("\tCaseRange{0x%04X, 0x%04X, d{UpperLower, UpperLower, UpperLower}},\n", fmt.Printf("\t{0x%04X, 0x%04X, d{UpperLower, UpperLower, UpperLower}},\n",
lo.point, hi.point) lo.point, hi.point)
case hi.point > lo.point && lo.isLowerUpper(): case hi.point > lo.point && lo.isLowerUpper():
logger.Exitf("LowerUpper sequence: should not happen: U+%04X. If it's real, need to fix To()", lo.point) logger.Exitf("LowerUpper sequence: should not happen: U+%04X. If it's real, need to fix To()", lo.point)
fmt.Printf("\tCaseRange{0x%04X, 0x%04X, d{LowerUpper, LowerUpper, LowerUpper}},\n", fmt.Printf("\t{0x%04X, 0x%04X, d{LowerUpper, LowerUpper, LowerUpper}},\n",
lo.point, hi.point) lo.point, hi.point)
default: default:
fmt.Printf("\tCaseRange{0x%04X, 0x%04X, d{%d, %d, %d}},\n", fmt.Printf("\t{0x%04X, 0x%04X, d{%d, %d, %d}},\n",
lo.point, hi.point, lo.point, hi.point,
lo.deltaToUpper, lo.deltaToLower, lo.deltaToTitle) lo.deltaToUpper, lo.deltaToLower, lo.deltaToTitle)
} }

View File

@ -14,7 +14,7 @@ type T struct {
script string script string
} }
// Hand-chosen tests from Unicode 5.1.0, mostly to discover when new // Hand-chosen tests from Unicode 5.1.0 & 6.0..0, mostly to discover when new
// scripts and categories arise. // scripts and categories arise.
var inTest = []T{ var inTest = []T{
{0x06e2, "Arabic"}, {0x06e2, "Arabic"},
@ -22,11 +22,13 @@ var inTest = []T{
{0x10b20, "Avestan"}, {0x10b20, "Avestan"},
{0x1b37, "Balinese"}, {0x1b37, "Balinese"},
{0xa6af, "Bamum"}, {0xa6af, "Bamum"},
{0x1be1, "Batak"},
{0x09c2, "Bengali"}, {0x09c2, "Bengali"},
{0x3115, "Bopomofo"}, {0x3115, "Bopomofo"},
{0x282d, "Braille"}, {0x282d, "Braille"},
{0x1a1a, "Buginese"}, {0x1a1a, "Buginese"},
{0x1747, "Buhid"}, {0x1747, "Buhid"},
{0x11011, "Brahmi"},
{0x156d, "Canadian_Aboriginal"}, {0x156d, "Canadian_Aboriginal"},
{0x102a9, "Carian"}, {0x102a9, "Carian"},
{0xaa4d, "Cham"}, {0xaa4d, "Cham"},
@ -72,6 +74,7 @@ var inTest = []T{
{0x10290, "Lycian"}, {0x10290, "Lycian"},
{0x10930, "Lydian"}, {0x10930, "Lydian"},
{0x0d42, "Malayalam"}, {0x0d42, "Malayalam"},
{0x0843, "Mandaic"},
{0xabd0, "Meetei_Mayek"}, {0xabd0, "Meetei_Mayek"},
{0x1822, "Mongolian"}, {0x1822, "Mongolian"},
{0x104c, "Myanmar"}, {0x104c, "Myanmar"},
@ -204,7 +207,7 @@ func TestScripts(t *testing.T) {
} }
} }
for k := range notTested { for k := range notTested {
t.Error("not tested:", k) t.Error("script not tested:", k)
} }
} }
@ -223,7 +226,7 @@ func TestCategories(t *testing.T) {
notTested[test.script] = false, false notTested[test.script] = false, false
} }
for k := range notTested { for k := range notTested {
t.Error("not tested:", k) t.Error("category not tested:", k)
} }
} }
@ -242,6 +245,6 @@ func TestProperties(t *testing.T) {
notTested[test.script] = false, false notTested[test.script] = false, false
} }
for k := range notTested { for k := range notTested {
t.Error("not tested:", k) t.Error("property not tested:", k)
} }
} }

File diff suppressed because it is too large Load Diff