Skip to content
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

Implementing CLDR testing using unitsTest.txt #4422

Merged
merged 14 commits into from
Dec 16, 2023

Conversation

younies
Copy link
Member

@younies younies commented Dec 7, 2023

No description provided.

@younies younies requested a review from a team as a code owner December 7, 2023 16:37
#[test]
fn test_conversion() {
// let provider = icu_unitsconversion::provider::UnitsInfoV1;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sffc and @robertbastian ,

How could I read the provider UnitsInfoV1 here, because I need its info in the testing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can I use let provider = AnyPayload::new_default::<UnitsInfoV1>();

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are you testing?

If you are testing data generation, the test should go in datagen

If you are testing functionality, you should implement the functionality and hook up compiled data.

Copy link
Member Author

@younies younies Dec 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, I am testing that all input and output units if they are parsable. In the next PR, I will use the same test to test convertibility and conversion.

I need to access the UnitsInfoV1 to create a parser right now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from @robertbastian , look at the translitrator, use BakedData

@@ -0,0 +1,245 @@
# Test data for unit conversions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By convention, this should be located at experimental/unitsconversion/tests/data/unitsTest.txt

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -25,6 +25,7 @@ databake = { workspace = true, optional = true, features = ["derive"]}
displaydoc = { version = "0.2.3", default-features = false }
icu_locid = { workspace = true }
icu_provider = { workspace = true, features = ["macros"] }
num = "0.4.1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue: dev dependency

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

#[test]
fn test_conversion() {
// let provider = icu_unitsconversion::provider::UnitsInfoV1;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are you testing?

If you are testing data generation, the test should go in datagen

If you are testing functionality, you should implement the functionality and hook up compiled data.

@younies younies requested a review from sffc December 7, 2023 17:44
@sffc sffc removed their request for review December 8, 2023 02:16
#[clippy::msrv = "1.67"]
impl $provider {
#[doc(hidden)]
pub const SINGLETON_UNITS_INFO_V1: &'static <icu::unitsconversion::provider::UnitsInfoV1Marker as icu_provider::DataMarker>::Yokeable = &icu::unitsconversion::provider::UnitsInfoV1 { units_conversion_trie: zerotrie::ZeroTrieSimpleAscii { store: unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\xE1x1abcdefghijklmnopqrstvwy\0\0\0\0\x01\x01\x01\x02\x02\x02\x02\x02\x02\x02\x02\x03\x03\x03\x03\x04\x04\x04\x04\rJ\x8B\xE3:b\xBF\x04,8N\x8F\xAE\xE8\xFF*\xA2\xB9\xE7e\x9C\xA1\xBD00-kilometer\x80\xC5cmrst\x03\x08\x1A*re\x81pere\x82c-\xC2ms\x06inute\x83econd\x84tronomical-unit\x85mosphere\x86\xC6aeiruy\x06\x0E\x10'2r\x87rel\x88cquerel\x89t\x8Aitish-thermal-unit\x8B-it\x8C\xC2-s\x03jp\x8Dhel\x8Ete\x8F\xC5aehou\x1B+5<\xC3lnr\x0B\x11orie\x90\0-it\x90\x01dela\x90\x02at\x90\x03\xC2ln\x06sius\x90\x04tury\x90\x05\xC2ao\x04in\x90\x06\x90\x07ulomb\x90\x08p\x90\t-\xC2jm\x03p\x90\netric\x90\x0B\xC5aeoru\x14;>H\xC2ly\x05ton\x90\x0C\x90\r-person\x90\x0E\xC3cgs\x05\nade\x90\x0Free\x90\x10sert-spoon\x90\x11-imperial\x90\x12t\x90\x13\xC2ao\x03m\x90\x14p\x90\x15nam\x90\x16\xC3alm\x14 rth-\xC2mr\x05ass\x90\x17adius\x90\x18ectronvolt\x90\x19\x90\x1A\xC4alou\x18.I\xC3hrt\t\rrenheit\x90\x1Bad\x90\x1Chom\x90\x1Duid-ounce\x90\x1E-imperial\x90\x1F\xC2or\x0F\xC2dt\tcalorie\x90 \x90!tnight\x90\"\xC2nr\x02\x90#long\x90$\xC3-ar\x071force\x90%\xC2ls\x10lon\x90&-imperial\x90'oline-energy-density\x90(a\xC3imy\x03\x05n\x90)\x90*\x90+\xC2eo\x14\xC3cnr\x06\ntare\x90,ry\x90-tz\x90.\xC2ru\tsepower\x90/r\x900\xC2nt\x04ch\x901em\x902\xC2io\x06gger\x903\xC2-u\x04jp\x904le\x905\xC5aeino\x0C\x17'+\xC2rt\x04at\x906al\x907\xC2ln\x05vin\x908\x909logram\x90:-force\x90;ot\x90<\xC2ks\x03u\x90=aji\x90>\xC2iu\x11\xC2gt\tht-year\x90?er\x90@\xC2mx\x04en\x90A\x90B\xC3eio\x05 ter\x90C\xC2ln\x12e\x90D-scandinavian\x90Eute\x90F\xC2ln\x03e\x90Gth\x90H-person\x90I\xC2ae\rutical-mile\x90Jwton\x90K\xC4fhsu\x0F\x12\x17\xC2gh\x08lucose\x90Lg\x90Mm\x90Naji\x90Once\x90P-troy\x90Q\xC4aeio\x0E.T\xC2rs\x05sec\x90Rcal\x90Sr\xC2cm\x05ent\x90T\xC2iy\x0Cll\xC2ei\x02\x90Uon\x90Vriad\x90W\xC2nx\x1E\xC2ct\x03h\x90X\x90Y-\xC2im\tmperial\x90Zetric\x90[el\x90\\\xC3iru\x04\nnt\x90]tion\x90^nd\x90_-force\x90`uart\x90a\xC2-e\nimperial\x90br\x90c\xC4aeio\x0F\x19#\xC2dn\x05ian\x90dkine\x90evolution\x90f\xC2-n\x04jp\x90g\x90hd\x90i\xC8aehilotu\x03\x10'6:[ki\x90j\xC2-c\x04jp\x90kond\x90laku\x90m-\xC2cl\x06loth\x90nength\x90oe\xC2mv\x05ens\x90pert\x90qug\x90rlar-\xC3lmr\x0B\x10uminosity\x90sass\x90tadius\x90u\xC2eo\x08radian\x90vne\x90wn\x90x\xC4aeho\n\x19!blespoon\x90y\xC2as\x07spoon\x90zla\x90{erm-us\x90|\xC2-n\x04jp\x90}\x90~ne\x90\x7Folt\x91\0\xC2ae\x04tt\x91\x01\xC2be\x04er\x91\x02k\x91\x03-person\x91\x04\xC2ae\x04rd\x91\x05ar\x91\x06-person\x91\x07") } }.into_zerotrie(), convert_infos: unsafe { zerovec::VarZeroVec::from_bytes_unchecked(b"\x98\0\0\0\0\0&\0O\0s\0\x98\0\xBE\0\xE6\0\x16\x01F\x01r\x01\x96\x01\xBA\x01\xEF\x01$\x02I\x02v\x02\x9A\x02\xC9\x02\xF9\x02\x1D\x03B\x03g\x03\x8B\x03\xB1\x03\xD7\x03\0\x04,\x04Q\x04v\x04\xAD\x04\xD3\x04\xF9\x04\x1D\x05B\x05n\x05\x98\x05\xBC\x05\xE8\x05\x15\x06:\x06h\x06\x8E\x06\xC8\x06\xEC\x06\x11\x07D\x07j\x07\x96\x07\xC0\x07\xEF\x07\x15\x08;\x08`\x08\x85\x08\xB1\x08\xDC\x08\x05\t=\tg\t\x8C\t\xB5\t\xDA\t\r\n6\no\n\x94\n\xB9\n\xDD\n\t\x0B-\x0B[\x0B\x7F\x0B\xB1\x0B\xD5\x0B\xF9\x0B\x1D\x0CN\x0Cy\x0C\x9F\x0C\xC5\x0C\xEF\x0C\x14\rB\rk\r\x8F\r\xB5\r\xDA\r\xFE\r+\x0EO\x0Es\x0E\x98\x0E\xC6\x0E\xFD\x0E1\x0Fd\x0F\x8A\x0F\xB4\x0F\xDD\x0F\x0E\x10<\x10`\x10\x85\x10\xAB\x10\xD0\x10\xFD\x10(\x11Q\x11v\x11\x9A\x11\xC0\x11\xE4\x11\x0E\x12F\x12q\x12\x9A\x12\xBE\x12\xE8\x12\x0C\x130\x13U\x13z\x13\xA0\x13\xC8\x13\xED\x13\x11\x149\x14]\x14\x81\x14\xB4\x14\xDD\x14\n\x15C\x15s\x15\x9A\x15\xCB\x15\xF5\x15\x1A\x16F\x16r\x16\xA0\x16\xD1\x16\xF8\x16 \x17E\x17x\x17\xA6\x17\xD9\x17\xFF\x17%\x18K\x18o\x18\0\0\0\x05\0\0\0\0\0\0\0\x05\0\0\0\x08\0\0\0\t\0\0\0\n\0\0\0\x01\0\0S\0\xA0\x86\x01\x01\0\x01\0\0\0\x05\0\0\0\0\0\0\0\x05\0\0\0\t\0\0\0\x0C\0\0\0\r\0\0\0\x02\0\0S\0\x92:\xD8\x12-1\x01\0\x01\0\0\0\x05\0\0\0\0\0\0\0\x05\0\0\0\x06\0\0\0\x07\0\0\0\x08\0\0\0\x01\0\0\x02\0\x01\x01\0\x01\0\0\0\x05\0\0\0\0\0\0\0\x05\0\0\0\x06\0\0\0\x08\0\0\0\t\0\0\0\x01\0\0v\0\x01`T\0\x01\0\0\0\x05\0\0\0\0\0\0\0\x05\0\0\0\x06\0\0\0\t\0\0\0\n\0\0\0\x01\0\0v\0\x01\x80\xC6\x13\0\x01\0\0\0\x05\0\0\0\0\0\0\0\x05\0\0\0\n\0\0\0\x0B\0\0\0\x0C\0\0\0\x01\0\0S\0lZ\xBA\xD4\"\x01\0\x01\0\0\0\x05\0\0\0\0\0\0\0\x0F\0\0\0\x12\0\0\0\x13\0\0\0\x14\0\0\0\x01\x03\0:\0\xFF\0\0S\0\xFE\0\0|\0\xCD\x8B\x01\x01\0\x01\0\0\0\x05\0\0\0\0\0\0\0\x0F\0\0\0\x12\0\0\0\x13\0\0\0\x14\0\0\0\x01\x03\0:\0\xFF\0\0S\0\xFE\0\0|\0\xA0\x86\x01\x01\0\x01\0\0\0\x05\0\0\0\0\0\0\0\x05\0\0\0\n\0\0\0\x0F\0\0\0\x10\0\0\0\x03\0\0S\0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\0\0\x05\0\0\0\x07\0\0\0\n\0\0\0\x0B\0\0\0\x03\0\0S\0a\t\xEC\x07\x02\0\x01\0\0\0\x05\0\0\0\0\0\0\0\x05\0\0\0\t\0\0\0\x0B\0\0\0\x0C\0\0\0\x01\x03\0:\0\x85 \xB4\x02P\xC3\0\x01\0\0\0\x05\0\0\0\0\0\0\0\x05\0\0\0\x07\0\0\0\x08\0\0\0\t\0\0\0\x01\x03\0:\0\xE8\x03\x01\0\x01\0\0\0\x05\0\0\0\0\0\0\0\x14\0\0\0\x15\0\0\0\x16\0\0\0\x17\0\0\0\x01\x03\0:\0\x02\0\0S\0\xFD\0\0|\0\xFF\0\0\x02\0\x01\x01\0\x01\0\0\0\x05\0\0\0\0\0\0\0\x0F\0\0\0\x10\0\0\0\x11\0\0\0\x12\0\0\0\x01\x03\0:\0\x02\0\0S\0\xFD\0\0|\0\x01\x01\0\x01\0\0\0\x05\0\0\0\0\0\0\0\x14\0\0\0\x15\0\0\0\x16\0\0\0\x17\0\0\0\x01\x03\0:\0\x02\0\0S\0\xFE\0\0|\0\xFF\0\0\x02\0\x01\x01\0\x01\0\0\0\x05\0\0\0\0\0\0\0\x05\0\0\0\x08\0\0\0\t\0\0\0\n\0\0\0\x01\0\0|\0\x80:\t\x01\0\x01\0\0\0\x05\0\0\0\0\0\0\0\x05\0\0\0\x08\0\0\0\t\0\0\0\n\0\0\0\x01\0\0|\0\x80:\t\x01\0\x01\0\0\0\x05\0\0\0\0\0\0\0\x05\0\0\0\x07\0\0\0\t\0\0\0\n\0\0\0\x01\0\0S\0w\x04\xE2\x04\0\x01\0\0\0\x05\0\0\0\0\0\0\0\x05\0\0\0\x06\0\0\0\x07\0\0\0\x08\0\0\0\x01\0\0\x96\0\x01\x01\0\x01\0\0\0\x05\0\0\0\0\0\0\0\x05\0\0\0\x06\0\0\0\x07\0\0\0\x08\0\0\0\x01\0\0\x96\0\x01\x01\0\x01") } };
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robertbastian : how to read this in experimental/unitsconversion/tests/units_test.rs

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

icu_unitsconversion::provider::Baked::SINGLETON_UNITS_INFO_V1

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx :)

@younies younies requested a review from sffc December 14, 2023 15:53
@younies younies changed the title Add unitsTest.txt to to the testing folder Implementing CLDR testing using UnitsTest.txt Dec 14, 2023
@younies younies changed the title Implementing CLDR testing using UnitsTest.txt Implementing CLDR testing using unitsTest.txt Dec 14, 2023
Comment on lines 5 to 6
#[cfg(test)]
mod tests {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not requires in a tests/ test

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

.cloned()
.collect();
for test in tests {
// TODO: remove this line after fixing the parser.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you have an issue?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done: #4461

.collect();

let parser = MeasureUnitParser::from_payload(
&icu_unitsconversion::provider::Baked::SINGLETON_UNITS_INFO_V1.units_conversion_trie,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you following the transliteration model with baked data in the tests/ folder, or are you properly hooking up baked date with a icu_units_conversion_data crate? In the former case, this is not correct, in the latter you don't need the files in tests/data

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I saw at the transliteration, they have copied the baked data into tests.

Can I read the data directly from the Datagen place?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok, then my response before to use it like this was incorrect. Check the documentation in macros.rs for how to use it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, we can just access the data directly.

robertbastian
robertbastian previously approved these changes Dec 15, 2023
assert!(output_unit.is_ok());
}

// let parser = MeasureUnitParser::from_payload(&BakedDataProvider);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot to delete, done

@younies younies merged commit 92a839b into unicode-org:main Dec 16, 2023
29 checks passed
@younies younies deleted the add-testcases branch December 16, 2023 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants