mirror of
https://github.com/tiffany352/rink-rs
synced 2024-09-20 14:12:00 +00:00
Cover more cases in Context::describe_unit
This commit is contained in:
parent
260de942d4
commit
3e2003e31c
1 changed files with 15 additions and 1 deletions
|
@ -113,12 +113,26 @@ fn test_conformance() {
|
|||
"Conformance error: 1 watt (power) != 1 joule (energy)\n\
|
||||
Suggestions: multiply left side by time, multiply right side by frequency",
|
||||
);
|
||||
|
||||
test(
|
||||
"W/s -> J^2",
|
||||
"Conformance error: 1 newton^2 / kilogram != 1 joule^2\n\
|
||||
Suggestions: multiply left side by moment_of_inertia, divide right side by moment_of_inertia",
|
||||
);
|
||||
test(
|
||||
"m^2 -> kg^2",
|
||||
"Conformance error: 1 meter^2 (area) != 1 kilogram^2 (kg^2)\n\
|
||||
Suggestions: multiply left side by linear_density^2, multiply right side by area / mass^2",
|
||||
);
|
||||
test(
|
||||
"c -> kg",
|
||||
"Conformance error: 299792458 meter / second (velocity) != 1 kilogram (mass)\n\
|
||||
Suggestions: multiply left side by mass time / length, multiply right side by length / mass time"
|
||||
);
|
||||
test(
|
||||
"1/m -> 'abc'",
|
||||
"Conformance error: 1 / meter (m^-1) != 1 abc (abc)\n\
|
||||
Suggestions: multiply left side by 'abc' length, divide right side by 'abc' length",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Reference in a new issue