icu_testdata
is a unit testing package for [ICU4X
].
The package exposes a DataProvider
with stable data useful for unit testing. The data is
based on a CLDR tag and a short list of locales that, together, cover a range of scenarios.
The list of locales and the current CLDR tag can be found in Cargo.toml.
The output data can be found in the data subdirectory.
If you wish to run ICU4X tests with custom test data, you may do so by setting the "ICU4XTESTDATADIR" environment variable:
bash
$ ICU4X_TESTDATA_DIR=/path/to/custom/testdata cargo test
From this directory, run:
bash
$ cargo gen-testdata -v
Use -v
, -vv
, or -vvv
for different verbosities of logging.
Use -m generate
to generate the testdata without downloading it first:
bash
$ cargo gen-testdata -v -m generate
```rust use std::borrow::Cow; use icuprovider::prelude::*; use iculocid_macros::langid;
let dataprovider = icutestdata::get_provider();
let data: Cow
For more information on development, authorship, contributing etc. please visit ICU4X home page
.