-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Go 1.16 supports Unicode 13. Update testdata accordingly. Add test generation script, set max version in build constraint, and update CI.
- Loading branch information
1 parent
6ce40ef
commit 560c18f
Showing
8 changed files
with
30 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,5 @@ | |
!go.mod | ||
!go.sum | ||
!*.md | ||
!*.go | ||
!*.go | ||
!*.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module github.com/smasher164/xid | ||
|
||
go 1.15 | ||
go 1.14 | ||
|
||
require golang.org/x/text v0.3.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# This script generates testdata for particular version of unicode. | ||
# Used Python 3.8.7 && regex==2020.2.20 to generate cases for unicode 12.1.0. | ||
# Used Python 3.9.1 && regex>2020.2.20 to generate cases for unicode 13.0.0. | ||
|
||
import unicodedata | ||
import regex | ||
import sys | ||
import gzip | ||
|
||
def gendata(category): | ||
f = gzip.open(f'{category}{unicodedata.unidata_version}.txt.gz', 'wb') | ||
for r in range(sys.maxunicode+1): | ||
matched = bool(regex.match(f'\p{{{category}}}', chr(r))) | ||
if matched: | ||
f.write(b'T') | ||
else: | ||
f.write(b'F') | ||
|
||
gendata('xid_start') | ||
gendata('xid_continue') |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// +build go1.14 | ||
// +build go1.14,!go1.16 | ||
|
||
package xid | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// +build go1.16 | ||
|
||
package xid | ||
|
||
const unicodeTestVersion = "13.0.0" |