mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
refactor(core): consolidate epoch-millisecond conversions (#7161)
This commit is contained in:
1 parent
94d7b2c031
commit
d4f87659a7
28 files changed
+107
-91
No files matched your search
@@ -20,6 +20,13 @@ class EpochSecondsTest {
|
||||
assertEquals(-0.001, EpochSeconds.fromInstant(Instant.ofEpochSecond(-1, 999_999_999)));
|
||||
}
|
||||
|
||||
@Test
|
||||
void convertsLongEpochMillisWithoutLosingMillisecondFraction() {
|
||||
assertEquals(1_790_312_384.592, EpochSeconds.fromMillis(1_790_312_384_592L));
|
||||
assertEquals(-0.001, EpochSeconds.fromMillis(-1L));
|
||||
assertEquals(0.001, EpochSeconds.fromMillis(1L));
|
||||
}
|
||||
|
||||
@Test
|
||||
void retainsNullAndOverflowFailures() {
|
||||
assertThrows(NullPointerException.class, () -> EpochSeconds.fromInstant(null));
|
||||
|
||||
Reference in new issue
Block a user