From b5657e796eb4d2d28fe21243b389034c908cdf82 Mon Sep 17 00:00:00 2001 From: Zibi Braniecki Date: Thu, 8 Oct 2020 19:20:44 -0700 Subject: [PATCH] Use testdata everywhere --- components/datetime/benches/datetime.rs | 2 +- .../benches/fixtures/tests/styles.json | 24 +++++++++---------- components/datetime/examples/work_log.rs | 2 +- components/datetime/tests/datetime.rs | 2 +- .../data/icu4x/dates/gregory@1/en.json | 1 - .../data/icu4x/dates/gregory@1/pl.json | 1 - .../fixtures/data/icu4x/dates/manifest.json | 4 ---- .../tests/fixtures/data/icu4x/manifest.json | 5 ---- .../datetime/tests/fixtures/tests/styles.json | 4 ++-- .../fs-data-provider/tests/test_file_io.rs | 8 +++---- .../testdata/json_plurals_37/manifest.json | 5 ---- .../plurals/cardinal@1/ar.json | 7 ------ .../plurals/cardinal@1/de.json | 7 ------ .../plurals/cardinal@1/en.json | 7 ------ .../plurals/cardinal@1/iw.json | 7 ------ .../plurals/cardinal@1/sr.json | 7 ------ .../plurals/cardinal@1/und.json | 7 ------ .../plurals/cardinal@1/zh.json | 7 ------ .../json_plurals_37/plurals/ordinal@1/ar.json | 7 ------ .../json_plurals_37/plurals/ordinal@1/en.json | 7 ------ .../json_plurals_37/plurals/ordinal@1/es.json | 7 ------ .../json_plurals_37/plurals/ordinal@1/he.json | 7 ------ .../json_plurals_37/plurals/ordinal@1/sr.json | 7 ------ .../plurals/ordinal@1/und.json | 7 ------ .../plurals/ordinal@1/yue.json | 7 ------ .../pluralrules/benches/fixtures/plurals.json | 2 +- components/pluralrules/benches/parser.rs | 2 +- components/pluralrules/benches/pluralrules.rs | 2 +- .../pluralrules/examples/elevator_floors.rs | 2 +- .../pluralrules/examples/unread_emails.rs | 2 +- .../tests/data/json_plurals_37/manifest.json | 5 ---- .../plurals/cardinal@1/ar.json | 1 - .../plurals/cardinal@1/cs.json | 1 - .../plurals/cardinal@1/de.json | 1 - .../plurals/cardinal@1/en.json | 1 - .../plurals/cardinal@1/es.json | 1 - .../plurals/cardinal@1/fr.json | 1 - .../plurals/cardinal@1/it.json | 1 - .../plurals/cardinal@1/pl.json | 1 - .../plurals/cardinal@1/sk.json | 1 - .../plurals/cardinal@1/uk.json | 1 - .../plurals/cardinal@1/zh.json | 1 - .../json_plurals_37/plurals/ordinal@1/ar.json | 1 - .../json_plurals_37/plurals/ordinal@1/cs.json | 1 - .../json_plurals_37/plurals/ordinal@1/de.json | 1 - .../json_plurals_37/plurals/ordinal@1/en.json | 1 - .../json_plurals_37/plurals/ordinal@1/es.json | 1 - .../json_plurals_37/plurals/ordinal@1/fr.json | 1 - .../json_plurals_37/plurals/ordinal@1/it.json | 1 - .../json_plurals_37/plurals/ordinal@1/pl.json | 1 - .../json_plurals_37/plurals/ordinal@1/sk.json | 1 - .../json_plurals_37/plurals/ordinal@1/uk.json | 1 - .../json_plurals_37/plurals/ordinal@1/zh.json | 1 - components/pluralrules/tests/plurals.rs | 4 ++-- 54 files changed, 28 insertions(+), 169 deletions(-) delete mode 100644 components/datetime/tests/fixtures/data/icu4x/dates/gregory@1/en.json delete mode 100644 components/datetime/tests/fixtures/data/icu4x/dates/gregory@1/pl.json delete mode 100644 components/datetime/tests/fixtures/data/icu4x/dates/manifest.json delete mode 100644 components/datetime/tests/fixtures/data/icu4x/manifest.json delete mode 100644 components/fs-data-provider/tests/testdata/json_plurals_37/manifest.json delete mode 100644 components/fs-data-provider/tests/testdata/json_plurals_37/plurals/cardinal@1/ar.json delete mode 100644 components/fs-data-provider/tests/testdata/json_plurals_37/plurals/cardinal@1/de.json delete mode 100644 components/fs-data-provider/tests/testdata/json_plurals_37/plurals/cardinal@1/en.json delete mode 100644 components/fs-data-provider/tests/testdata/json_plurals_37/plurals/cardinal@1/iw.json delete mode 100644 components/fs-data-provider/tests/testdata/json_plurals_37/plurals/cardinal@1/sr.json delete mode 100644 components/fs-data-provider/tests/testdata/json_plurals_37/plurals/cardinal@1/und.json delete mode 100644 components/fs-data-provider/tests/testdata/json_plurals_37/plurals/cardinal@1/zh.json delete mode 100644 components/fs-data-provider/tests/testdata/json_plurals_37/plurals/ordinal@1/ar.json delete mode 100644 components/fs-data-provider/tests/testdata/json_plurals_37/plurals/ordinal@1/en.json delete mode 100644 components/fs-data-provider/tests/testdata/json_plurals_37/plurals/ordinal@1/es.json delete mode 100644 components/fs-data-provider/tests/testdata/json_plurals_37/plurals/ordinal@1/he.json delete mode 100644 components/fs-data-provider/tests/testdata/json_plurals_37/plurals/ordinal@1/sr.json delete mode 100644 components/fs-data-provider/tests/testdata/json_plurals_37/plurals/ordinal@1/und.json delete mode 100644 components/fs-data-provider/tests/testdata/json_plurals_37/plurals/ordinal@1/yue.json delete mode 100644 components/pluralrules/tests/data/json_plurals_37/manifest.json delete mode 100644 components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/ar.json delete mode 100644 components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/cs.json delete mode 100644 components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/de.json delete mode 100644 components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/en.json delete mode 100644 components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/es.json delete mode 100644 components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/fr.json delete mode 100644 components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/it.json delete mode 100644 components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/pl.json delete mode 100644 components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/sk.json delete mode 100644 components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/uk.json delete mode 100644 components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/zh.json delete mode 100644 components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/ar.json delete mode 100644 components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/cs.json delete mode 100644 components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/de.json delete mode 100644 components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/en.json delete mode 100644 components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/es.json delete mode 100644 components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/fr.json delete mode 100644 components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/it.json delete mode 100644 components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/pl.json delete mode 100644 components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/sk.json delete mode 100644 components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/uk.json delete mode 100644 components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/zh.json diff --git a/components/datetime/benches/datetime.rs b/components/datetime/benches/datetime.rs index db780e3a3c4..f006d92293b 100644 --- a/components/datetime/benches/datetime.rs +++ b/components/datetime/benches/datetime.rs @@ -10,7 +10,7 @@ use icu_fs_data_provider::FsDataProvider; fn datetime_benches(c: &mut Criterion) { let fxs = fixtures::get_fixture("styles").unwrap(); - let provider = FsDataProvider::try_new("./tests/fixtures/data/icu4x") + let provider = FsDataProvider::try_new("../../resources/testdata/data/json") .expect("Loading file from testdata directory"); { diff --git a/components/datetime/benches/fixtures/tests/styles.json b/components/datetime/benches/fixtures/tests/styles.json index a11da1a8b92..15b4bd99374 100644 --- a/components/datetime/benches/fixtures/tests/styles.json +++ b/components/datetime/benches/fixtures/tests/styles.json @@ -2,7 +2,7 @@ { "setups": [ { - "locale": "pl", + "locale": "be", "options": { "style": { "date": "full", @@ -11,7 +11,7 @@ } }, { - "locale": "pl", + "locale": "be", "options": { "style": { "date": "long", @@ -20,7 +20,7 @@ } }, { - "locale": "pl", + "locale": "be", "options": { "style": { "date": "medium", @@ -29,7 +29,7 @@ } }, { - "locale": "pl", + "locale": "be", "options": { "style": { "date": "short", @@ -38,7 +38,7 @@ } }, { - "locale": "pl", + "locale": "be", "options": { "style": { "date": null, @@ -47,7 +47,7 @@ } }, { - "locale": "pl", + "locale": "be", "options": { "style": { "date": null, @@ -56,7 +56,7 @@ } }, { - "locale": "pl", + "locale": "be", "options": { "style": { "date": null, @@ -65,7 +65,7 @@ } }, { - "locale": "pl", + "locale": "be", "options": { "style": { "date": null, @@ -74,7 +74,7 @@ } }, { - "locale": "pl", + "locale": "be", "options": { "style": { "date": "full", @@ -83,7 +83,7 @@ } }, { - "locale": "pl", + "locale": "be", "options": { "style": { "date": "long", @@ -92,7 +92,7 @@ } }, { - "locale": "pl", + "locale": "be", "options": { "style": { "date": "medium", @@ -101,7 +101,7 @@ } }, { - "locale": "pl", + "locale": "be", "options": { "style": { "date": "short", diff --git a/components/datetime/examples/work_log.rs b/components/datetime/examples/work_log.rs index eb27d9fb1c2..45f75c4ff0a 100644 --- a/components/datetime/examples/work_log.rs +++ b/components/datetime/examples/work_log.rs @@ -30,7 +30,7 @@ fn print(_input: &str, _value: Option) { fn main() { let langid: LanguageIdentifier = "en".parse().expect("Failed to parse Language Identifier."); - let provider = FsDataProvider::try_new("./tests/fixtures/data/icu4x") + let provider = FsDataProvider::try_new("../../resources/testdata/data/json") .expect("Loading file from testdata directory"); let dates = DATES_ISO diff --git a/components/datetime/tests/datetime.rs b/components/datetime/tests/datetime.rs index c7c90b5a906..75888a953ab 100644 --- a/components/datetime/tests/datetime.rs +++ b/components/datetime/tests/datetime.rs @@ -7,7 +7,7 @@ use std::fmt::Write; #[test] fn test_fixtures() { - let provider = FsDataProvider::try_new("./tests/fixtures/data/icu4x") + let provider = FsDataProvider::try_new("../../resources/testdata/data/json") .expect("Loading file from testdata directory"); for fx in fixtures::get_fixture("styles").unwrap().0 { diff --git a/components/datetime/tests/fixtures/data/icu4x/dates/gregory@1/en.json b/components/datetime/tests/fixtures/data/icu4x/dates/gregory@1/en.json deleted file mode 100644 index 62b3151792c..00000000000 --- a/components/datetime/tests/fixtures/data/icu4x/dates/gregory@1/en.json +++ /dev/null @@ -1 +0,0 @@ -{"symbols":{"months":{"format":{"abbreviated":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"narrow":["J","F","M","A","M","J","J","A","S","O","N","D"],"wide":["January","February","March","April","May","June","July","August","September","October","November","December"]}},"weekdays":{"format":{"abbreviated":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"narrow":["S","M","T","W","T","F","S"],"short":["Su","Mo","Tu","We","Th","Fr","Sa"],"wide":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]}},"day_periods":{"format":{"abbreviated":{"am":"AM","pm":"PM"},"narrow":{"am":"a","pm":"p"},"wide":{"am":"AM","pm":"PM"}},"stand_alone":{"narrow":{"am":"AM","pm":"PM"}}}},"patterns":{"date":{"full":"EEEE, MMMM d, y","long":"MMMM d, y","medium":"MMM d, y","short":"M/d/yy"},"time":{"full":"h:mm:ss a zzzz","long":"h:mm:ss a z","medium":"h:mm:ss a","short":"h:mm a"},"date_time":{"full":"{1} 'at' {0}","long":"{1} 'at' {0}","medium":"{1}, {0}","short":"{1}, {0}"}}} diff --git a/components/datetime/tests/fixtures/data/icu4x/dates/gregory@1/pl.json b/components/datetime/tests/fixtures/data/icu4x/dates/gregory@1/pl.json deleted file mode 100644 index f5c69ba1236..00000000000 --- a/components/datetime/tests/fixtures/data/icu4x/dates/gregory@1/pl.json +++ /dev/null @@ -1 +0,0 @@ -{"symbols":{"months":{"format":{"abbreviated":["sty","lut","mar","kwi","maj","cze","lip","sie","wrz","paź","lis","gru"],"narrow":["s","l","m","k","m","c","l","s","w","p","l","g"],"wide":["stycznia","lutego","marca","kwietnia","maja","czerwca","lipca","sierpnia","września","października","listopada","grudnia"]},"stand_alone":{"narrow":["S","L","M","K","M","C","L","S","W","P","L","G"],"wide":["styczeń","luty","marzec","kwiecień","maj","czerwiec","lipiec","sierpień","wrzesień","październik","listopad","grudzień"]}},"weekdays":{"format":{"abbreviated":["niedz.","pon.","wt.","śr.","czw.","pt.","sob."],"narrow":["n","p","w","ś","c","p","s"],"short":["nie","pon","wto","śro","czw","pią","sob"],"wide":["niedziela","poniedziałek","wtorek","środa","czwartek","piątek","sobota"]},"stand_alone":{"narrow":["N","P","W","Ś","C","P","S"]}},"day_periods":{"format":{"abbreviated":{"am":"AM","pm":"PM"},"narrow":{"am":"a","pm":"p"},"wide":{"am":"AM","pm":"PM"}}}},"patterns":{"date":{"full":"EEEE, d MMMM y","long":"d MMMM y","medium":"d MMM y","short":"dd.MM.y"},"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}"}}} diff --git a/components/datetime/tests/fixtures/data/icu4x/dates/manifest.json b/components/datetime/tests/fixtures/data/icu4x/dates/manifest.json deleted file mode 100644 index a68a792a8e3..00000000000 --- a/components/datetime/tests/fixtures/data/icu4x/dates/manifest.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "aliasing": "NoAliases", - "syntax": "Json" -} diff --git a/components/datetime/tests/fixtures/data/icu4x/manifest.json b/components/datetime/tests/fixtures/data/icu4x/manifest.json deleted file mode 100644 index c0f2b714d99..00000000000 --- a/components/datetime/tests/fixtures/data/icu4x/manifest.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "aliasing": "NoAliases", - "locales": "IncludeAll", - "syntax": "Json" -} diff --git a/components/datetime/tests/fixtures/tests/styles.json b/components/datetime/tests/fixtures/tests/styles.json index d33a0047c8f..a3d2481e2da 100644 --- a/components/datetime/tests/fixtures/tests/styles.json +++ b/components/datetime/tests/fixtures/tests/styles.json @@ -91,7 +91,7 @@ }, { "input": { - "locale": "pl", + "locale": "be", "value": "2020-03-21T08:25:07.000", "options": { "style": { @@ -101,7 +101,7 @@ } }, "output": { - "value": "sobota, 21 marca 2020 08:25:07 zzzz" + "value": "субота, 21 сакавіка 2020 'г'. 'у' 08:25:07, zzzz" } } ] diff --git a/components/fs-data-provider/tests/test_file_io.rs b/components/fs-data-provider/tests/test_file_io.rs index b7a0b74fd20..82d67382a4b 100644 --- a/components/fs-data-provider/tests/test_file_io.rs +++ b/components/fs-data-provider/tests/test_file_io.rs @@ -5,7 +5,7 @@ use std::borrow::Cow; #[test] fn test_read_json() { - let provider = FsDataProvider::try_new("tests/testdata/json_plurals_37") + let provider = FsDataProvider::try_new("../../resources/testdata/data/json") .expect("Loading file from testdata directory"); let response = provider .load(&DataRequest { @@ -13,7 +13,7 @@ fn test_read_json() { data_entry: DataEntry { variant: None, // TODO: Migrate to LanguageIdentifier macro - langid: "sr".parse().expect("Valid language tag"), + langid: "en".parse().expect("Valid language tag"), }, }) .expect("The key should be present in the testdata"); @@ -24,9 +24,9 @@ fn test_read_json() { plurals_data, &structs::plurals::PluralRuleStringsV1 { zero: None, - one: Some(Cow::Borrowed("v = 0 and i % 10 = 1 and i % 100 != 11 or f % 10 = 1 and f % 100 != 11 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, … @decimal 0.1, 1.1, 2.1, 3.1, 4.1, 5.1, 6.1, 7.1, 10.1, 100.1, 1000.1, …")), + one: Some(Cow::Borrowed("i = 1 and v = 0")), two: None, - few: Some(Cow::Borrowed("v = 0 and i % 10 = 2..4 and i % 100 != 12..14 or f % 10 = 2..4 and f % 100 != 12..14 @integer 2~4, 22~24, 32~34, 42~44, 52~54, 62, 102, 1002, … @decimal 0.2~0.4, 1.2~1.4, 2.2~2.4, 3.2~3.4, 4.2~4.4, 5.2, 10.2, 100.2, 1000.2, …")), + few: None, many: None, } ); diff --git a/components/fs-data-provider/tests/testdata/json_plurals_37/manifest.json b/components/fs-data-provider/tests/testdata/json_plurals_37/manifest.json deleted file mode 100644 index c0f2b714d99..00000000000 --- a/components/fs-data-provider/tests/testdata/json_plurals_37/manifest.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "aliasing": "NoAliases", - "locales": "IncludeAll", - "syntax": "Json" -} diff --git a/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/cardinal@1/ar.json b/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/cardinal@1/ar.json deleted file mode 100644 index bfb875aea5e..00000000000 --- a/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/cardinal@1/ar.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "zero": "n = 0 @integer 0 @decimal 0.0, 0.00, 0.000, 0.0000", - "one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000", - "two": "n = 2 @integer 2 @decimal 2.0, 2.00, 2.000, 2.0000", - "few": "n % 100 = 3..10 @integer 3~10, 103~110, 1003, … @decimal 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 103.0, 1003.0, …", - "many": "n % 100 = 11..99 @integer 11~26, 111, 1011, … @decimal 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 111.0, 1011.0, …" -} diff --git a/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/cardinal@1/de.json b/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/cardinal@1/de.json deleted file mode 100644 index 53ff26df1b5..00000000000 --- a/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/cardinal@1/de.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "zero": null, - "one": "i = 1 and v = 0 @integer 1", - "two": null, - "few": null, - "many": null -} diff --git a/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/cardinal@1/en.json b/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/cardinal@1/en.json deleted file mode 100644 index 53ff26df1b5..00000000000 --- a/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/cardinal@1/en.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "zero": null, - "one": "i = 1 and v = 0 @integer 1", - "two": null, - "few": null, - "many": null -} diff --git a/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/cardinal@1/iw.json b/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/cardinal@1/iw.json deleted file mode 100644 index 99613c0d10f..00000000000 --- a/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/cardinal@1/iw.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "zero": null, - "one": "i = 1 and v = 0 @integer 1", - "two": "i = 2 and v = 0 @integer 2", - "few": null, - "many": "v = 0 and n != 0..10 and n % 10 = 0 @integer 20, 30, 40, 50, 60, 70, 80, 90, 100, 1000, 10000, 100000, 1000000, …" -} diff --git a/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/cardinal@1/sr.json b/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/cardinal@1/sr.json deleted file mode 100644 index 5b20b081ddc..00000000000 --- a/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/cardinal@1/sr.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "zero": null, - "one": "v = 0 and i % 10 = 1 and i % 100 != 11 or f % 10 = 1 and f % 100 != 11 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, … @decimal 0.1, 1.1, 2.1, 3.1, 4.1, 5.1, 6.1, 7.1, 10.1, 100.1, 1000.1, …", - "two": null, - "few": "v = 0 and i % 10 = 2..4 and i % 100 != 12..14 or f % 10 = 2..4 and f % 100 != 12..14 @integer 2~4, 22~24, 32~34, 42~44, 52~54, 62, 102, 1002, … @decimal 0.2~0.4, 1.2~1.4, 2.2~2.4, 3.2~3.4, 4.2~4.4, 5.2, 10.2, 100.2, 1000.2, …", - "many": null -} diff --git a/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/cardinal@1/und.json b/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/cardinal@1/und.json deleted file mode 100644 index 09656a23d93..00000000000 --- a/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/cardinal@1/und.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "zero": null, - "one": null, - "two": null, - "few": null, - "many": null -} diff --git a/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/cardinal@1/zh.json b/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/cardinal@1/zh.json deleted file mode 100644 index 09656a23d93..00000000000 --- a/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/cardinal@1/zh.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "zero": null, - "one": null, - "two": null, - "few": null, - "many": null -} diff --git a/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/ordinal@1/ar.json b/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/ordinal@1/ar.json deleted file mode 100644 index 09656a23d93..00000000000 --- a/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/ordinal@1/ar.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "zero": null, - "one": null, - "two": null, - "few": null, - "many": null -} diff --git a/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/ordinal@1/en.json b/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/ordinal@1/en.json deleted file mode 100644 index 70718946ebc..00000000000 --- a/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/ordinal@1/en.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "zero": null, - "one": "n % 10 = 1 and n % 100 != 11 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, …", - "two": "n % 10 = 2 and n % 100 != 12 @integer 2, 22, 32, 42, 52, 62, 72, 82, 102, 1002, …", - "few": "n % 10 = 3 and n % 100 != 13 @integer 3, 23, 33, 43, 53, 63, 73, 83, 103, 1003, …", - "many": null -} diff --git a/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/ordinal@1/es.json b/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/ordinal@1/es.json deleted file mode 100644 index 09656a23d93..00000000000 --- a/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/ordinal@1/es.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "zero": null, - "one": null, - "two": null, - "few": null, - "many": null -} diff --git a/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/ordinal@1/he.json b/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/ordinal@1/he.json deleted file mode 100644 index 09656a23d93..00000000000 --- a/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/ordinal@1/he.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "zero": null, - "one": null, - "two": null, - "few": null, - "many": null -} diff --git a/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/ordinal@1/sr.json b/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/ordinal@1/sr.json deleted file mode 100644 index 09656a23d93..00000000000 --- a/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/ordinal@1/sr.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "zero": null, - "one": null, - "two": null, - "few": null, - "many": null -} diff --git a/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/ordinal@1/und.json b/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/ordinal@1/und.json deleted file mode 100644 index 09656a23d93..00000000000 --- a/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/ordinal@1/und.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "zero": null, - "one": null, - "two": null, - "few": null, - "many": null -} diff --git a/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/ordinal@1/yue.json b/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/ordinal@1/yue.json deleted file mode 100644 index 09656a23d93..00000000000 --- a/components/fs-data-provider/tests/testdata/json_plurals_37/plurals/ordinal@1/yue.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "zero": null, - "one": null, - "two": null, - "few": null, - "many": null -} diff --git a/components/pluralrules/benches/fixtures/plurals.json b/components/pluralrules/benches/fixtures/plurals.json index 26043549570..1386332f6b3 100644 --- a/components/pluralrules/benches/fixtures/plurals.json +++ b/components/pluralrules/benches/fixtures/plurals.json @@ -1,3 +1,3 @@ { - "langs": ["uk", "de", "sk", "ar", "fr", "it", "en", "cs", "es", "zh"] + "langs": ["be", "bn", "en", "fa", "fr", "und", "zh"] } diff --git a/components/pluralrules/benches/parser.rs b/components/pluralrules/benches/parser.rs index 38545fc9830..6225cde8f9c 100644 --- a/components/pluralrules/benches/parser.rs +++ b/components/pluralrules/benches/parser.rs @@ -12,7 +12,7 @@ fn parser(c: &mut Criterion) { let plurals_data = helpers::get_plurals_data(); - let provider = FsDataProvider::try_new("./tests/data/json_plurals_37") + let provider = FsDataProvider::try_new("../../resources/testdata/data/json") .expect("Loading file from testdata directory"); let mut rules = vec![]; diff --git a/components/pluralrules/benches/pluralrules.rs b/components/pluralrules/benches/pluralrules.rs index e9e365a7bfb..dbc14e9e3c6 100644 --- a/components/pluralrules/benches/pluralrules.rs +++ b/components/pluralrules/benches/pluralrules.rs @@ -10,7 +10,7 @@ fn pluralrules(c: &mut Criterion) { let plurals_data = helpers::get_plurals_data(); let numbers_data = helpers::get_numbers_data(); - let provider = FsDataProvider::try_new("./tests/data/json_plurals_37") + let provider = FsDataProvider::try_new("../../resources/testdata/data/json") .expect("Loading file from testdata directory"); c.bench_function("pluralrules/overview", |b| { diff --git a/components/pluralrules/examples/elevator_floors.rs b/components/pluralrules/examples/elevator_floors.rs index c678c62c810..4ce5a91bcb2 100644 --- a/components/pluralrules/examples/elevator_floors.rs +++ b/components/pluralrules/examples/elevator_floors.rs @@ -17,7 +17,7 @@ fn print(_input: &str, _value: Option) { fn main() { let langid: LanguageIdentifier = "en".parse().expect("Failed to parse Language Identifier."); - let dtp = FsDataProvider::try_new("./tests/data/json_plurals_37") + let dtp = FsDataProvider::try_new("../../resources/testdata/data/json") .expect("Loading file from testdata directory"); { diff --git a/components/pluralrules/examples/unread_emails.rs b/components/pluralrules/examples/unread_emails.rs index 2054f1dc443..42cb6724a92 100644 --- a/components/pluralrules/examples/unread_emails.rs +++ b/components/pluralrules/examples/unread_emails.rs @@ -17,7 +17,7 @@ fn print(_input: &str, _value: Option) { fn main() { let langid: LanguageIdentifier = "en".parse().expect("Failed to parse Language Identifier."); - let dtp = FsDataProvider::try_new("./tests/data/json_plurals_37") + let dtp = FsDataProvider::try_new("../../resources/testdata/data/json") .expect("Loading file from testdata directory"); { diff --git a/components/pluralrules/tests/data/json_plurals_37/manifest.json b/components/pluralrules/tests/data/json_plurals_37/manifest.json deleted file mode 100644 index c0f2b714d99..00000000000 --- a/components/pluralrules/tests/data/json_plurals_37/manifest.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "aliasing": "NoAliases", - "locales": "IncludeAll", - "syntax": "Json" -} diff --git a/components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/ar.json b/components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/ar.json deleted file mode 100644 index 7b3c120389e..00000000000 --- a/components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/ar.json +++ /dev/null @@ -1 +0,0 @@ -{"zero":"n = 0","one":"n = 1","two":"n = 2","few":"n % 100 = 3..10","many":"n % 100 = 11..99"} diff --git a/components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/cs.json b/components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/cs.json deleted file mode 100644 index 68bb8dda2b9..00000000000 --- a/components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/cs.json +++ /dev/null @@ -1 +0,0 @@ -{"one":"i = 1 and v = 0","few":"i = 2..4 and v = 0","many":"v != 0"} diff --git a/components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/de.json b/components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/de.json deleted file mode 100644 index 4ce936fa8e6..00000000000 --- a/components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/de.json +++ /dev/null @@ -1 +0,0 @@ -{"one":"i = 1 and v = 0"} diff --git a/components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/en.json b/components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/en.json deleted file mode 100644 index 4ce936fa8e6..00000000000 --- a/components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/en.json +++ /dev/null @@ -1 +0,0 @@ -{"one":"i = 1 and v = 0"} diff --git a/components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/es.json b/components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/es.json deleted file mode 100644 index a6f90482493..00000000000 --- a/components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/es.json +++ /dev/null @@ -1 +0,0 @@ -{"one":"n = 1"} diff --git a/components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/fr.json b/components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/fr.json deleted file mode 100644 index 51be304b297..00000000000 --- a/components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/fr.json +++ /dev/null @@ -1 +0,0 @@ -{"one":"i = 0,1"} diff --git a/components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/it.json b/components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/it.json deleted file mode 100644 index 4ce936fa8e6..00000000000 --- a/components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/it.json +++ /dev/null @@ -1 +0,0 @@ -{"one":"i = 1 and v = 0"} diff --git a/components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/pl.json b/components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/pl.json deleted file mode 100644 index 8ef0fdc5b44..00000000000 --- a/components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/pl.json +++ /dev/null @@ -1 +0,0 @@ -{"one":"i = 1 and v = 0","few":"v = 0 and i % 10 = 2..4 and i % 100 != 12..14","many":"v = 0 and i != 1 and i % 10 = 0..1 or v = 0 and i % 10 = 5..9 or v = 0 and i % 100 = 12..14"} diff --git a/components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/sk.json b/components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/sk.json deleted file mode 100644 index 68bb8dda2b9..00000000000 --- a/components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/sk.json +++ /dev/null @@ -1 +0,0 @@ -{"one":"i = 1 and v = 0","few":"i = 2..4 and v = 0","many":"v != 0"} diff --git a/components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/uk.json b/components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/uk.json deleted file mode 100644 index 7a63d744146..00000000000 --- a/components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/uk.json +++ /dev/null @@ -1 +0,0 @@ -{"one":"v = 0 and i % 10 = 1 and i % 100 != 11","few":"v = 0 and i % 10 = 2..4 and i % 100 != 12..14","many":"v = 0 and i % 10 = 0 or v = 0 and i % 10 = 5..9 or v = 0 and i % 100 = 11..14"} diff --git a/components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/zh.json b/components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/zh.json deleted file mode 100644 index 0967ef424bc..00000000000 --- a/components/pluralrules/tests/data/json_plurals_37/plurals/cardinal@1/zh.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/ar.json b/components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/ar.json deleted file mode 100644 index 0967ef424bc..00000000000 --- a/components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/ar.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/cs.json b/components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/cs.json deleted file mode 100644 index 0967ef424bc..00000000000 --- a/components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/cs.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/de.json b/components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/de.json deleted file mode 100644 index 0967ef424bc..00000000000 --- a/components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/de.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/en.json b/components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/en.json deleted file mode 100644 index 62555fbefbd..00000000000 --- a/components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/en.json +++ /dev/null @@ -1 +0,0 @@ -{"one":"n % 10 = 1 and n % 100 != 11","two":"n % 10 = 2 and n % 100 != 12","few":"n % 10 = 3 and n % 100 != 13"} diff --git a/components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/es.json b/components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/es.json deleted file mode 100644 index 0967ef424bc..00000000000 --- a/components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/es.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/fr.json b/components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/fr.json deleted file mode 100644 index a6f90482493..00000000000 --- a/components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/fr.json +++ /dev/null @@ -1 +0,0 @@ -{"one":"n = 1"} diff --git a/components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/it.json b/components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/it.json deleted file mode 100644 index 75b1e4e10a3..00000000000 --- a/components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/it.json +++ /dev/null @@ -1 +0,0 @@ -{"many":"n = 11,8,80,800"} diff --git a/components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/pl.json b/components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/pl.json deleted file mode 100644 index 0967ef424bc..00000000000 --- a/components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/pl.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/sk.json b/components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/sk.json deleted file mode 100644 index 0967ef424bc..00000000000 --- a/components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/sk.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/uk.json b/components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/uk.json deleted file mode 100644 index 22830f0e248..00000000000 --- a/components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/uk.json +++ /dev/null @@ -1 +0,0 @@ -{"few":"n % 10 = 3 and n % 100 != 13"} diff --git a/components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/zh.json b/components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/zh.json deleted file mode 100644 index 0967ef424bc..00000000000 --- a/components/pluralrules/tests/data/json_plurals_37/plurals/ordinal@1/zh.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/components/pluralrules/tests/plurals.rs b/components/pluralrules/tests/plurals.rs index 271f65e4cc3..750dc4b8f1d 100644 --- a/components/pluralrules/tests/plurals.rs +++ b/components/pluralrules/tests/plurals.rs @@ -4,7 +4,7 @@ use icu_pluralrules::{PluralCategory, PluralRuleType, PluralRules}; #[test] fn test_plural_rules() { - let dp = FsDataProvider::try_new("./tests/data/json_plurals_37") + let dp = FsDataProvider::try_new("../../resources/testdata/data/json") .expect("Loading file from testdata directory"); let lang: LanguageIdentifier = "en".parse().unwrap(); @@ -16,7 +16,7 @@ fn test_plural_rules() { #[test] fn test_plural_rules_missing() { - let dp = FsDataProvider::try_new("./tests/data/json_plurals_37") + let dp = FsDataProvider::try_new("../../resources/testdata/data/json") .expect("Loading file from testdata directory"); let lang: LanguageIdentifier = "xx".parse().unwrap();