Skip to content

Commit

Permalink
Try to find the edge cases that work across platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
dkhalanskyjb committed Apr 17, 2024
1 parent c96d955 commit 8391eff
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/common/test/samples/InstantSamples.kt
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,11 @@ class InstantSamples {

@Test
fun minusDateTimeUnit() {
val startInstant = Instant.parse("2024-05-02T08:55:40.322Z")
val startInstant = Instant.parse("2024-03-28T02:04:56.256Z")
val twoYearsEarlierInBerlin = startInstant.minus(2, DateTimeUnit.YEAR, TimeZone.of("Europe/Berlin"))
check(twoYearsEarlierInBerlin == Instant.parse("2022-05-02T08:55:40.322Z"))
check(twoYearsEarlierInBerlin == Instant.parse("2022-03-28T01:04:56.256Z"))
val twoYearsEarlierInCairo = startInstant.minus(2, DateTimeUnit.YEAR, TimeZone.of("Africa/Cairo"))
check(twoYearsEarlierInCairo == Instant.parse("2022-05-02T09:55:40.322Z"))
check(twoYearsEarlierInCairo == Instant.parse("2022-03-28T02:04:56.256Z"))
}

@Test
Expand Down

0 comments on commit 8391eff

Please sign in to comment.