17 releases (10 stable)

1.5.0 May 28, 2024
1.4.0 Nov 17, 2023
1.3.3 Oct 10, 2023
1.2.0 Apr 14, 2023
0.1.0 Oct 15, 2020

#481 in Internationalization (i18n)

Download history 868/week @ 2024-08-01 1232/week @ 2024-08-08 1313/week @ 2024-08-15 510/week @ 2024-08-22 970/week @ 2024-08-29 663/week @ 2024-09-05 578/week @ 2024-09-12 405/week @ 2024-09-19 312/week @ 2024-09-26 171/week @ 2024-10-03 157/week @ 2024-10-10 136/week @ 2024-10-17 206/week @ 2024-10-24 298/week @ 2024-10-31 362/week @ 2024-11-07 280/week @ 2024-11-14

1,221 downloads per month
Used in 6 crates (4 directly)

Unicode-3.0

13MB
77K SLoC

icu_testdata crates.io

🚧 This crate has been superseded by ICU4X's compiled_data feature and is deprecated. Data for new components will not be added, and it will not be updated for ICU4X 2.0.

icu_testdata is a unit testing crate for ICU4X.

The crate exposes data providers 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 crate exposes three kinds of providers, corresponding to the three types of constructors in ICU:

Examples

use icu::locid::locale;
use icu_provider::hello_world::HelloWorldFormatter;

// Unstable constructor
HelloWorldFormatter::try_new_unstable(
    &icu_testdata::unstable(),
    &locale!("en-CH").into(),
).unwrap();

// AnyProvider constructor
HelloWorldFormatter::try_new_with_any_provider(
    &icu_testdata::any(),
    &locale!("en-CH").into(),
).unwrap();

// BufferProvider constructor (`icu` with `serde` feature, `icu_testdata` with `buffer` feature)
HelloWorldFormatter::try_new_with_buffer_provider(
    &icu_testdata::buffer(),
    &locale!("en-CH").into(),
).unwrap();

// Without fallback the locale match needs to be exact
HelloWorldFormatter::try_new_unstable(
    &icu_testdata::unstable_no_fallback(),
    &locale!("en-CH").into(),
).is_err();

HelloWorldFormatter::try_new_unstable(
    &icu_testdata::unstable_no_fallback(),
    &locale!("en").into(),
).unwrap();

More Information

For more information on development, authorship, contributing etc. please visit ICU4X home page.

Dependencies

~5.5MB
~80K SLoC