From 3e2003e31c8a8271bbffa305b80e2f5e37413e0a Mon Sep 17 00:00:00 2001 From: Colin Benner Date: Sun, 30 Sep 2018 09:05:06 +0200 Subject: [PATCH] Cover more cases in Context::describe_unit --- tests/query.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/query.rs b/tests/query.rs index 6628c82..705ecd4 100644 --- a/tests/query.rs +++ b/tests/query.rs @@ -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]