Add tests for binary function error cases

This commit is contained in:
Colin Benner 2018-10-03 20:01:43 +02:00
parent cb0b3a1c46
commit f396f8176e

View file

@ -383,3 +383,20 @@ fn test_mul_not_defined() {
"Operation is not defined: <1 (dimensionless)> * <2018-10-03 00:00:00 +00:00>",
);
}
#[test]
fn test_log_base_with_dimension() {
test(
"log(10, 5m)",
"Base must be dimensionless: log(10 (dimensionless), 5 meter (length))",
);
}
#[test]
fn test_hypot_dimension_mismatch() {
test(
"hypot(3s, 4m)",
"Arguments to hypot must have matching dimensionality: \
hypot(3 second (time), 4 meter (length))",
);
}