mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-27 00:57:19 +02:00
Allow dur/dur division (#3812)
It is perfectly valid to divide two durations, it is a ratio with no unit.
This commit is contained in:
parent
5c67d22540
commit
f73b42d23f
2 changed files with 7 additions and 9 deletions
|
@ -302,13 +302,10 @@ int TEST_NAME(int, char**) {
|
|||
}
|
||||
|
||||
// duration / duration -> duration
|
||||
try {
|
||||
Variant v55 = v5 / v5;
|
||||
t.fail("1200 / 1200 --> error");
|
||||
} catch (...) {
|
||||
t.pass("1200 / 1200 --> error");
|
||||
}
|
||||
|
||||
Variant v55 = v5 / v5;
|
||||
t.is(v55.type(), Variant::type_real, "1200 / 1200 --> real");
|
||||
t.is(v55.get_real(), 1.0, "1200 / 1200 --> 1.0");
|
||||
t.is((v5 / v52).get_real(), 3.14136, EPSILON, "1200 / 382 --> 3.14136");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue