diff --git a/nebulosa-test/src/main/kotlin/nebulosa/test/Http.kt b/nebulosa-test/src/main/kotlin/nebulosa/test/Http.kt index fc6bb6cf3..3360d6d70 100644 --- a/nebulosa-test/src/main/kotlin/nebulosa/test/Http.kt +++ b/nebulosa-test/src/main/kotlin/nebulosa/test/Http.kt @@ -40,6 +40,8 @@ fun download(url: String, extension: String = url.extensionFromUrl): Path { call.execute().use { it.body?.byteStream()?.transferAndCloseOutput(path.outputStream()) } + } else { + println("$path is already downloaded") } path diff --git a/nebulosa-time/src/test/kotlin/IERSTest.kt b/nebulosa-time/src/test/kotlin/IERSTest.kt index 36f6745c0..5c455f97a 100644 --- a/nebulosa-time/src/test/kotlin/IERSTest.kt +++ b/nebulosa-time/src/test/kotlin/IERSTest.kt @@ -12,15 +12,15 @@ class IERSTest { IERS.attach(IERSA) with(UTC(TimeYMDHMS(2022, 1, 1, 12, 0, 0.0)).ut1) { - whole shouldBe (2459581.0 plusOrMinus 1E-18) - fraction shouldBe (-1.2784074073774842e-06 plusOrMinus 1E-18) + whole shouldBe (2459581.0 plusOrMinus 1E-8) + fraction shouldBe (-1.2784074073774842e-06 plusOrMinus 1E-8) } with(UTC(TimeYMDHMS(2026, 1, 1, 12, 0, 0.0)).ut1) { - whole shouldBe (2461042.0 plusOrMinus 1E-18) - fraction shouldBe (1.1488645833633137E-6 plusOrMinus 1E-18) + whole shouldBe (2461042.0 plusOrMinus 1E-8) + fraction shouldBe (1.1488645833633137E-6 plusOrMinus 1E-8) } with(UTC(TimeYMDHMS(1964, 1, 1, 12, 0, 0.0)).ut1) { - whole shouldBe (2438396.0 plusOrMinus 1E-18) + whole shouldBe (2438396.0 plusOrMinus 1E-8) fraction shouldBe (9.353564814864956e-06 plusOrMinus 1E-8) } } @@ -30,15 +30,15 @@ class IERSTest { IERS.attach(IERSB) with(UTC(TimeYMDHMS(2022, 1, 1, 12, 0, 0.0)).ut1) { - whole shouldBe (2459581.0 plusOrMinus 1E-18) - fraction shouldBe (-1.2782876157107722e-06 plusOrMinus 1E-18) + whole shouldBe (2459581.0 plusOrMinus 1E-8) + fraction shouldBe (-1.2782876157107722E-6 plusOrMinus 1E-8) } with(UTC(TimeYMDHMS(2026, 1, 1, 12, 0, 0.0)).ut1) { - whole shouldBe (2461042.0 plusOrMinus 1E-18) - fraction shouldBe (6.586666666966254E-7 plusOrMinus 1E-18) + whole shouldBe (2461042.0 plusOrMinus 1E-8) + fraction shouldBe (6.586666666966254E-7 plusOrMinus 1E-8) } with(UTC(TimeYMDHMS(1964, 1, 1, 12, 0, 0.0)).ut1) { - whole shouldBe (2438396.0 plusOrMinus 1E-18) + whole shouldBe (2438396.0 plusOrMinus 1E-8) fraction shouldBe (-9.322685184683761e-07 plusOrMinus 1E-8) } } @@ -49,15 +49,15 @@ class IERSTest { IERS.attach(iersab) with(UTC(TimeYMDHMS(2022, 1, 1, 12, 0, 0.0)).ut1) { - whole shouldBe (2459581.0 plusOrMinus 1E-18) - fraction shouldBe (-1.2782876157107722e-06 plusOrMinus 1E-18) + whole shouldBe (2459581.0 plusOrMinus 1E-8) + fraction shouldBe (-1.2782876157107722e-06 plusOrMinus 1E-8) } with(UTC(TimeYMDHMS(2026, 1, 1, 12, 0, 0.0)).ut1) { - whole shouldBe (2461042.0 plusOrMinus 1E-18) - fraction shouldBe (1.1488645833633137E-6 plusOrMinus 1E-18) + whole shouldBe (2461042.0 plusOrMinus 1E-8) + fraction shouldBe (1.1488645833633137E-6 plusOrMinus 1E-8) } with(UTC(TimeYMDHMS(1964, 1, 1, 12, 0, 0.0)).ut1) { - whole shouldBe (2438396.0 plusOrMinus 1E-18) + whole shouldBe (2438396.0 plusOrMinus 1E-8) fraction shouldBe (-9.322685184683761e-07 plusOrMinus 1E-8) } } diff --git a/nebulosa-time/src/test/kotlin/SystemClockTest.kt b/nebulosa-time/src/test/kotlin/SystemClockTest.kt index 3b06cb7dc..31584edda 100644 --- a/nebulosa-time/src/test/kotlin/SystemClockTest.kt +++ b/nebulosa-time/src/test/kotlin/SystemClockTest.kt @@ -1,3 +1,4 @@ +import io.kotest.matchers.longs.shouldBeExactly import io.kotest.matchers.longs.shouldBeLessThanOrEqual import io.kotest.matchers.types.shouldBeSameInstanceAs import nebulosa.time.SystemClock @@ -11,12 +12,12 @@ class SystemClockTest { @Test fun systemDefault() { - ChronoUnit.MICROS.between(LocalDateTime.now(SystemClock), LocalDateTime.now()) shouldBeLessThanOrEqual 20000L + ChronoUnit.SECONDS.between(LocalDateTime.now(SystemClock), LocalDateTime.now()) shouldBeExactly 0L SystemClock.zone shouldBeSameInstanceAs ZoneId.systemDefault() TimeZone.setDefault(TimeZone.getTimeZone("America/Manaus")) - ChronoUnit.MICROS.between(LocalDateTime.now(SystemClock), LocalDateTime.now()) shouldBeLessThanOrEqual 20000L + ChronoUnit.SECONDS.between(LocalDateTime.now(SystemClock), LocalDateTime.now()) shouldBeExactly 0L SystemClock.zone shouldBeSameInstanceAs ZoneId.systemDefault() } }