Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
fc52d702
Commit
fc52d702
authored
Jan 31, 2011
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unicode: update to unicode 6.0.0
R=rsc CC=golang-dev
https://golang.org/cl/3981049
parent
61439186
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
312 additions
and
191 deletions
+312
-191
src/pkg/unicode/letter_test.go
src/pkg/unicode/letter_test.go
+2
-1
src/pkg/unicode/maketables.go
src/pkg/unicode/maketables.go
+5
-5
src/pkg/unicode/script_test.go
src/pkg/unicode/script_test.go
+7
-4
src/pkg/unicode/tables.go
src/pkg/unicode/tables.go
+298
-181
No files found.
src/pkg/unicode/letter_test.go
View file @
fc52d702
...
...
@@ -56,6 +56,7 @@ var letterTest = []int{
0xf9
,
0x2ec
,
0x535
,
0x620
,
0x6e6
,
0x93d
,
0xa15
,
...
...
@@ -85,7 +86,7 @@ var notletterTest = []int{
0x20
,
0x35
,
0x375
,
0x6
20
,
0x6
19
,
0x700
,
0xfffe
,
0x1ffff
,
...
...
src/pkg/unicode/maketables.go
View file @
fc52d702
...
...
@@ -32,7 +32,7 @@ func main() {
var
dataURL
=
flag
.
String
(
"data"
,
""
,
"full URL for UnicodeData.txt; defaults to --url/UnicodeData.txt"
)
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"
)
var
tablelist
=
flag
.
String
(
"tables"
,
"all"
,
...
...
@@ -382,7 +382,7 @@ func printCategories() {
type
Op
func
(
code
int
)
bool
const
format
=
"
\t
Range
{0x%04x, 0x%04x, %d},
\n
"
const
format
=
"
\t
{0x%04x, 0x%04x, %d},
\n
"
func
dumpRange
(
header
string
,
inCategory
Op
)
{
fmt
.
Print
(
header
)
...
...
@@ -805,14 +805,14 @@ func printCaseRange(lo, hi *caseState) {
}
switch
{
case
hi
.
point
>
lo
.
point
&&
lo
.
isUpperLower
()
:
fmt
.
Printf
(
"
\t
CaseRange
{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
)
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
)
fmt
.
Printf
(
"
\t
CaseRange
{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
)
default
:
fmt
.
Printf
(
"
\t
CaseRange
{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
.
deltaToUpper
,
lo
.
deltaToLower
,
lo
.
deltaToTitle
)
}
...
...
src/pkg/unicode/script_test.go
View file @
fc52d702
...
...
@@ -14,7 +14,7 @@ type T struct {
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.
var
inTest
=
[]
T
{
{
0x06e2
,
"Arabic"
},
...
...
@@ -22,11 +22,13 @@ var inTest = []T{
{
0x10b20
,
"Avestan"
},
{
0x1b37
,
"Balinese"
},
{
0xa6af
,
"Bamum"
},
{
0x1be1
,
"Batak"
},
{
0x09c2
,
"Bengali"
},
{
0x3115
,
"Bopomofo"
},
{
0x282d
,
"Braille"
},
{
0x1a1a
,
"Buginese"
},
{
0x1747
,
"Buhid"
},
{
0x11011
,
"Brahmi"
},
{
0x156d
,
"Canadian_Aboriginal"
},
{
0x102a9
,
"Carian"
},
{
0xaa4d
,
"Cham"
},
...
...
@@ -72,6 +74,7 @@ var inTest = []T{
{
0x10290
,
"Lycian"
},
{
0x10930
,
"Lydian"
},
{
0x0d42
,
"Malayalam"
},
{
0x0843
,
"Mandaic"
},
{
0xabd0
,
"Meetei_Mayek"
},
{
0x1822
,
"Mongolian"
},
{
0x104c
,
"Myanmar"
},
...
...
@@ -204,7 +207,7 @@ func TestScripts(t *testing.T) {
}
}
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
}
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
}
for
k
:=
range
notTested
{
t
.
Error
(
"not tested:"
,
k
)
t
.
Error
(
"
property
not tested:"
,
k
)
}
}
src/pkg/unicode/tables.go
View file @
fc52d702
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment