-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Includes tooling to re-generate the testdata.
- Loading branch information
Showing
40 changed files
with
1,986 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
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
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
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[alias] | ||
gen-testdata = "run --features=icu4x-gen-testdata --" |
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,93 @@ | ||
[package] | ||
name = "icu-testdata" | ||
description = "Test data for ICU4X, generated from CLDR." | ||
version = "0.0.1" | ||
authors = ["The ICU4X Project Developers"] | ||
edition = "2018" | ||
readme = "README.md" | ||
repository = "/~https://github.com/unicode-org/icu4x" | ||
license-file = "../../LICENSE" | ||
categories = ["internationalization"] | ||
include = [ | ||
"src/**/*", | ||
"Cargo.toml", | ||
"README.md" | ||
] | ||
|
||
# icu4x_testdata metadata: schema defined in ./src/metadata.rs | ||
[package.metadata.icu4x_testdata] | ||
|
||
# Locales to include in testdata. Keep this list somewhat short, but cover all features. | ||
locales = [ | ||
# Belarusian: | ||
# - Cyrillic script | ||
# - Interesting plural rules | ||
"be", | ||
|
||
# Bangla: | ||
# - Uses non-Latin numerals | ||
"bn", | ||
|
||
# Chakma: | ||
# - High-coverage language that uses non-BMP code points | ||
"ccp", | ||
|
||
# English: | ||
# - Widely understood language in software engineering | ||
# - Includes regional variants to test similar-data fallbacks | ||
"en", | ||
"en-US-posix", | ||
"en-ZA", | ||
|
||
# Farsi: | ||
# - Good example for RTL | ||
"fa", | ||
|
||
# French: | ||
# - Often the first non-English locale to receive new data in CLDR | ||
"fr", | ||
|
||
# Root data | ||
"und", | ||
|
||
# Chinese: | ||
# - The default "zh" uses Simplified Chinese | ||
# - Also include Traditional Chinese to test script variants | ||
"zh", | ||
"zh-Hant", | ||
] | ||
|
||
# Git tag or sha1 for the CLDR data used to generate the testdata | ||
gitref = "36.0.0" | ||
|
||
[dependencies] | ||
icu-data-provider = { path = "../../components/data-provider" } | ||
icu-fs-data-provider = { path = "../../components/fs-data-provider" } | ||
icu-locale = { path = "../../components/locale" } | ||
|
||
# Dependencies for the "metadata" feature | ||
serde = { version = "1.0", features = ["derive"], optional = true } | ||
serde_json = { version = "1.0", optional = true } | ||
|
||
# Dependencies for the binary | ||
cargo_metadata = { version = "0.11.3", optional = true } | ||
clap = { version = "2.33", optional = true } | ||
icu-cldr-json-data-provider = { path = "../../components/cldr-json-data-provider", optional = true, features = ["download"] } | ||
log = { version = "0.4", optional = true } | ||
simple_logger = { version = "1.10", optional = true } | ||
|
||
[features] | ||
metadata = ["serde", "serde_json", "icu-locale/serde"] | ||
icu4x-gen-testdata = [ | ||
"cargo_metadata", | ||
"clap", | ||
"icu-cldr-json-data-provider", | ||
"log", | ||
"simple_logger", | ||
"icu-fs-data-provider/export", | ||
"metadata", | ||
] | ||
|
||
[[bin]] | ||
name = "icu4x-gen-testdata" | ||
required-features = ["icu4x-gen-testdata"] |
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,22 @@ | ||
ICU4X Test Data | ||
=============== | ||
|
||
This project contains data used for ICU4X unit tests. The data is based on a CLDR tag and a short list of locales that, together, cover a range of scenarios that are useful in unit testing. | ||
|
||
The list of locales and the current CLDR tag can be found in [Cargo.toml](./Cargo.toml). | ||
|
||
The output data can be found in the [data](./data/) subdirectory. | ||
|
||
## Re-generating the data | ||
|
||
From this directory, run: | ||
|
||
```bash | ||
$ cargo gen-testdata | ||
``` | ||
|
||
To monitor the progress, run with `-v` or `-vv`: | ||
|
||
```bash | ||
$ cargo gen-testdata -vv | ||
``` |
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,162 @@ | ||
{ | ||
"symbols": { | ||
"months": { | ||
"format": { | ||
"abbreviated": [ | ||
"сту", | ||
"лют", | ||
"сак", | ||
"кра", | ||
"мая", | ||
"чэр", | ||
"ліп", | ||
"жні", | ||
"вер", | ||
"кас", | ||
"ліс", | ||
"сне" | ||
], | ||
"narrow": [ | ||
"с", | ||
"л", | ||
"с", | ||
"к", | ||
"м", | ||
"ч", | ||
"л", | ||
"ж", | ||
"в", | ||
"к", | ||
"л", | ||
"с" | ||
], | ||
"wide": [ | ||
"студзеня", | ||
"лютага", | ||
"сакавіка", | ||
"красавіка", | ||
"мая", | ||
"чэрвеня", | ||
"ліпеня", | ||
"жніўня", | ||
"верасня", | ||
"кастрычніка", | ||
"лістапада", | ||
"снежня" | ||
] | ||
}, | ||
"stand_alone": { | ||
"abbreviated": [ | ||
"сту", | ||
"лют", | ||
"сак", | ||
"кра", | ||
"май", | ||
"чэр", | ||
"ліп", | ||
"жні", | ||
"вер", | ||
"кас", | ||
"ліс", | ||
"сне" | ||
], | ||
"wide": [ | ||
"студзень", | ||
"люты", | ||
"сакавік", | ||
"красавік", | ||
"май", | ||
"чэрвень", | ||
"ліпень", | ||
"жнівень", | ||
"верасень", | ||
"кастрычнік", | ||
"лістапад", | ||
"снежань" | ||
] | ||
} | ||
}, | ||
"weekdays": { | ||
"format": { | ||
"abbreviated": [ | ||
"нд", | ||
"пн", | ||
"аў", | ||
"ср", | ||
"чц", | ||
"пт", | ||
"сб" | ||
], | ||
"narrow": [ | ||
"н", | ||
"п", | ||
"а", | ||
"с", | ||
"ч", | ||
"п", | ||
"с" | ||
], | ||
"short": [ | ||
"нд", | ||
"пн", | ||
"аў", | ||
"ср", | ||
"чц", | ||
"пт", | ||
"сб" | ||
], | ||
"wide": [ | ||
"нядзеля", | ||
"панядзелак", | ||
"аўторак", | ||
"серада", | ||
"чацвер", | ||
"пятніца", | ||
"субота" | ||
] | ||
} | ||
}, | ||
"day_periods": { | ||
"format": { | ||
"abbreviated": { | ||
"am": "AM", | ||
"pm": "PM" | ||
}, | ||
"narrow": { | ||
"am": "am", | ||
"pm": "pm" | ||
}, | ||
"wide": { | ||
"am": "AM", | ||
"pm": "PM" | ||
} | ||
}, | ||
"stand_alone": { | ||
"narrow": { | ||
"am": "AM", | ||
"pm": "PM" | ||
} | ||
} | ||
} | ||
}, | ||
"patterns": { | ||
"date": { | ||
"full": "EEEE, d MMMM y 'г'.", | ||
"long": "d MMMM y 'г'.", | ||
"medium": "d.MM.y", | ||
"short": "d.MM.yy" | ||
}, | ||
"time": { | ||
"full": "HH:mm:ss, zzzz", | ||
"long": "HH:mm:ss z", | ||
"medium": "HH:mm:ss", | ||
"short": "HH:mm" | ||
}, | ||
"date_time": { | ||
"full": "{1} 'у' {0}", | ||
"long": "{1} 'у' {0}", | ||
"medium": "{1}, {0}", | ||
"short": "{1}, {0}" | ||
} | ||
} | ||
} |
Oops, something went wrong.