Skip to content

Commit 1175630

Browse files
authored
Add helloworld to testdata (#2173)
1 parent b992515 commit 1175630

File tree

12 files changed

+63
-0
lines changed

12 files changed

+63
-0
lines changed

provider/testdata/data/baked/any.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ impl AnyProvider for BakedDataProvider {
126126
const WORDBREAKV1MARKER: ::icu_provider::ResourceKeyHash = ::icu_properties::provider::WordBreakV1Marker::KEY.get_hash();
127127
const XIDCONTINUEV1MARKER: ::icu_provider::ResourceKeyHash = ::icu_properties::provider::XidContinueV1Marker::KEY.get_hash();
128128
const XIDSTARTV1MARKER: ::icu_provider::ResourceKeyHash = ::icu_properties::provider::XidStartV1Marker::KEY.get_hash();
129+
const HELLOWORLDV1MARKER: ::icu_provider::ResourceKeyHash = ::icu_provider::hello_world::HelloWorldV1Marker::KEY.get_hash();
129130
const LOCALEFALLBACKLIKELYSUBTAGSV1MARKER: ::icu_provider::ResourceKeyHash =
130131
::icu_provider_adapters::fallback::provider::LocaleFallbackLikelySubtagsV1Marker::KEY.get_hash();
131132
const LOCALEFALLBACKPARENTSV1MARKER: ::icu_provider::ResourceKeyHash =
@@ -460,6 +461,9 @@ impl AnyProvider for BakedDataProvider {
460461
XIDSTARTV1MARKER => AnyPayload::from_static_ref::<<::icu_properties::provider::XidStartV1Marker as DataMarker>::Yokeable>(
461462
litemap_slice_get(props::xids_v1::DATA, key, req)?,
462463
),
464+
HELLOWORLDV1MARKER => AnyPayload::from_static_ref::<<::icu_provider::hello_world::HelloWorldV1Marker as DataMarker>::Yokeable>(
465+
litemap_slice_get(core::helloworld_v1::DATA, key, req)?,
466+
),
463467
LOCALEFALLBACKLIKELYSUBTAGSV1MARKER => AnyPayload::from_static_ref::<
464468
<::icu_provider_adapters::fallback::provider::LocaleFallbackLikelySubtagsV1Marker as DataMarker>::Yokeable,
465469
>(litemap_slice_get(fallback::likelysubtags_v1::DATA, key, req)?),
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// @generated
2+
type DataStruct = & 'static < :: icu_provider :: hello_world :: HelloWorldV1Marker as :: icu_provider :: DataMarker > :: Yokeable ;
3+
pub static DATA: &[(&str, DataStruct)] = &[("bn", BN), ("en", EN), ("ja", JA), ("ru", RU)];
4+
static BN: DataStruct = &::icu_provider::hello_world::HelloWorldV1 {
5+
message: alloc::borrow::Cow::Borrowed("ওহে বিশ\u{9cd}ব"),
6+
};
7+
static EN: DataStruct = &::icu_provider::hello_world::HelloWorldV1 {
8+
message: alloc::borrow::Cow::Borrowed("Hello World"),
9+
};
10+
static JA: DataStruct = &::icu_provider::hello_world::HelloWorldV1 {
11+
message: alloc::borrow::Cow::Borrowed("こんにちは世界"),
12+
};
13+
static RU: DataStruct = &::icu_provider::hello_world::HelloWorldV1 {
14+
message: alloc::borrow::Cow::Borrowed("Привет, мир"),
15+
};
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// @generated
2+
pub mod helloworld_v1;

provider/testdata/data/baked/mod.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// @generated
22
mod calendar;
33
mod collator;
4+
mod core;
45
mod datetime;
56
mod decimal;
67
mod fallback;
@@ -1496,6 +1497,23 @@ impl ResourceProvider<::icu_properties::provider::XidStartV1Marker> for BakedDat
14961497
})
14971498
}
14981499
}
1500+
impl ResourceProvider<::icu_provider::hello_world::HelloWorldV1Marker> for BakedDataProvider {
1501+
fn load_resource(
1502+
&self,
1503+
req: &DataRequest,
1504+
) -> Result<DataResponse<::icu_provider::hello_world::HelloWorldV1Marker>, DataError> {
1505+
Ok(DataResponse {
1506+
metadata: Default::default(),
1507+
payload: Some(DataPayload::from_owned(zerofrom::ZeroFrom::zero_from(
1508+
litemap_slice_get(
1509+
core::helloworld_v1::DATA,
1510+
<::icu_provider::hello_world::HelloWorldV1Marker as ResourceMarker>::KEY,
1511+
req,
1512+
)?,
1513+
))),
1514+
})
1515+
}
1516+
}
14991517
impl
15001518
ResourceProvider<
15011519
::icu_provider_adapters::fallback::provider::LocaleFallbackLikelySubtagsV1Marker,
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"message": "ওহে বিশ্ব"
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"message": "Hello World"
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"message": "こんにちは世界"
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"message": "Привет, мир"
3+
}

provider/testdata/data/json/fingerprints.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ collator/prim@1/und: 99339a081619a4cd8cc3328afab61613b70b4b44b168b1b0f916862b9b3
1717
collator/reord@1/bn: e6d9e14f9b89e321e4f600bbcaf61fcf4505cce659779a1b9fb75d91bc0b8377
1818
collator/reord@1/ja: f2f72df03dada6da2354056f82b6508632ad8a5aba825e6365c6c4356ed482d7
1919
collator/reord@1/th: 21ba21c536e9208f502ed205e16da58920dfe1fc1fa5c04110b8099e56d85074
20+
core/helloworld@1/bn: 73fbb6436bef1256c13f401ebcd6d3ac2df63a885f68073375139ea1c87c875f
21+
core/helloworld@1/en: 51dae8b726b73af2a08428d5a068bf1fa2f95ccf2bedb55545222ae27c35d7be
22+
core/helloworld@1/ja: cc12b67e983566343e5ca4d193753ed34c7493952a24ca6d9a752d5ba4080dc2
23+
core/helloworld@1/ru: 5e1591de56258fcd925675f8f9548f69c09e50fba8239ee20348c6f134e0d652
2024
datetime/datelengths@1/ar-EG-u-ca-buddhist: 058dd3f41bf4dcb7cdd79f0fe81046cc029623cb266e8ef914f148d8df63f496
2125
datetime/datelengths@1/ar-EG-u-ca-coptic: 058dd3f41bf4dcb7cdd79f0fe81046cc029623cb266e8ef914f148d8df63f496
2226
datetime/datelengths@1/ar-EG-u-ca-ethiopic: 058dd3f41bf4dcb7cdd79f0fe81046cc029623cb266e8ef914f148d8df63f496

provider/testdata/data/postcard/fingerprints.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ collator/prim@1/und: b04e2fbd4549df42c1238c03a02ff4028be27a1aea05845de977ff75857
1717
collator/reord@1/bn: d9407753d5addbf44ce6862828d7823b43143d43de1e1cf755540515682ffcfe
1818
collator/reord@1/ja: 45d276fad04f69cf39b95eb98a39010ddd490692df09b92e32d673e833d19ea4
1919
collator/reord@1/th: 80e0a2d0d7ca240c6e31270d93479ab865c3a73ce0dfae52ddf2a3b7d4e10baf
20+
core/helloworld@1/bn: aa2d572f5f82a2a725a6dcaa468246092c432bb652e263ed0f58dd1a0b8e7893
21+
core/helloworld@1/en: 17b4ffecef199f366da18885ccb843fe070b837876e8d0851c0ec6a73edf253c
22+
core/helloworld@1/ja: 19cb1643bc27796db5bc2cfdabe00df1466d97b1a42252b49e569f7f9f4d76f7
23+
core/helloworld@1/ru: 7b7f5791198c97cc71126268bb1d0cd522ba89cab1312426bcba6a03be8933a5
2024
datetime/datelengths@1/ar-EG-u-ca-buddhist: dd871b659c616e1ddd92bcad284381289aeafd7cead6f6cce7d9a76018b253c9
2125
datetime/datelengths@1/ar-EG-u-ca-coptic: dd871b659c616e1ddd92bcad284381289aeafd7cead6f6cce7d9a76018b253c9
2226
datetime/datelengths@1/ar-EG-u-ca-ethiopic: dd871b659c616e1ddd92bcad284381289aeafd7cead6f6cce7d9a76018b253c9
137 Bytes
Binary file not shown.

provider/testdata/src/bin/datagen.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use icu_datagen::*;
66
use icu_locid::langid;
7+
use icu_provider::ResourceMarker;
78
use icu_provider_fs::export::serializers::{json, postcard};
89
use icu_testdata::{metadata, paths};
910
use std::fs::File;
@@ -71,6 +72,9 @@ fn main() {
7172
&icu_datagen::all_keys()
7273
.into_iter()
7374
.filter(|k| !IGNORED_KEYS.contains(&k.get_path()))
75+
.chain(core::iter::once(
76+
icu_provider::hello_world::HelloWorldV1Marker::KEY,
77+
))
7478
.collect::<Vec<_>>(),
7579
&source_data,
7680
vec![json_out, blob_out, mod_out, postcard_out],

0 commit comments

Comments
 (0)