-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating unit tests using icu_testdata #2800
Comments
Is it possible to use BufferProvider (such as FsDataProvider, or icu_testdata::buffer()) as a provider for the following: icu_properties::sets (i.e. sets::load_pattern_white_space()), and icu_segmenter::GraphemeClusterBreakSegmenter::try_new_unstable()? Or does one need to construct own methods to extract properties data using something similar to
, and similarly construct own method to obtain segmenter? |
First of all, if you need segmenter data, which is still experimental (pending #2259), you need to explicitly enable the Once you enable the feature, If you want to use a BufferProvider, you should use the |
Thanks for advice. In buf.rs: Perhaps part of the reason why I am struggling to get icu_testdata and FsDataProvider to work. Seems icu_properties or icu_segmenter crates does not have methods with |
You will need to activate the Also note that the data format is not CLDR data, but a custom format compiled from CLDR (through |
For a unit test I am trying to create a data provider using the data of the icu_testdata crate, as it does contain Pattern_White_Space and Pattern_Syntax properties, and has a sample of Grapheme Segmenter data.
I do see 3 small examples, yet can't figure out how to expand the examples to have a single provider that supports: DataProvider + DataProvider + DataProvider.
I need to pass a single provider to a function that supports the 3 data types:
I believe a slightly more complex example that uses combination data type provider would help new users of the icu crates to create the unit tests using icu_testdata, and in general extend it to using icu_fs_provider for ICU data included in application.
Though I do see an issue for OS installed ICU data provider being proposed as an enhancement, which could reduce application installation size, and the applications are not concerned of the small changes taking place in the OS installed ICU data as OS updates takes place.
The text was updated successfully, but these errors were encountered: