-
Notifications
You must be signed in to change notification settings - Fork 55
Implement Summable, Invertible, Comparable for Duration #714
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Dirk Lattermann <dlkw@dlkw.de>
|
Is the |
|
See the test module docs, so, yes. |
| => assertEquals (Comparison.greater, Duration(3450) <=> Duration(456)); | ||
|
|
||
| shared test void testCompare() | ||
| => assertEquals (Comparison.equal, Duration(345) <=> Duration(346)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
345 and 346 obviously should not be considered equal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, of course not, at least not if it's milliseconds of a duration. 😃
Sorry—fixed.
Signed-off-by: Dirk Lattermann <dlkw@dlkw.de>
Some of your tests have the |
|
|
||
| shared actual Duration negated => Duration(milliseconds.negated); | ||
|
|
||
| shared actual Duration minus(Duration other) => Duration(milliseconds.minus(other.milliseconds)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn’t this be simpler to read:
milliseconds - other.milliseconds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to make it visible that it just delegates to the corresponding method on the milliseconds, but I won't object changing it if you like. Should I?
Signed-off-by: Dirk Lattermann <dlkw@dlkw.de>
Signed-off-by: Dirk Lattermann <dlkw@dlkw.de>
Implements #713
Are tests in ceylon-sdk supposed to be running through? I could not get them to compile:
Signed-off-by: Dirk Lattermann dlkw@dlkw.de