Test conversion to list

This commit is contained in:
Colin Benner 2018-10-05 13:31:30 +02:00
parent 62459d05b5
commit 67e98857de

View file

@ -517,3 +517,20 @@ fn test_no_calls_on_rhs() {
"Calls are not allowed in the right hand side of conversions",
);
}
#[test]
fn test_conversion_to_list() {
test(
"ly -> teram,Gm,Mm,km,m",
"9.46 kiloteram, 730 gigameter, 472 megameter, 580 kilometer, 800 meter (length)",
);
test(
"1 -> m, hour",
"Units in unit list must conform: <1 meter (length)> ; <3.6 kilosecond (time)>",
);
test(
"1g -> m, cm",
"Conformance error: 1 gram (mass) != 1 meter (length)\n\
Suggestions: divide left side by linear_density, multiply right side by linear_density",
);
}