Skip to content

Commit

Permalink
Merge pull request #62 from ikr/negative-delta-item
Browse files Browse the repository at this point in the history
2 failing tests to illustrate a problem with Duration.diff
  • Loading branch information
rluiten authored Jan 19, 2018
2 parents ba7bd49 + 007c8bb commit dd5bf02
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/Date/Extra/DurationTests.elm
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,34 @@ tests =
)
)
]
, describe "Duration.diff on directly created dates"
[ test "2019-01-01 — 2018-01-11T21:00:00" <|
\_ ->
let
y2019m01d01 =
Date.fromTime 1546300800000

y2018m01d11h21 =
Date.fromTime 1515704400000

d =
Duration.diff y2019m01d01 y2018m01d11h21
in
Expect.equal d (Duration.DeltaRecord 0 11 20 3 0 0 0)
, test "2019-01-11 — 2018-01-11T21:00:00" <|
\_ ->
let
y2019m01d11 =
Date.fromTime 1547164800000

y2018m01d11h21 =
Date.fromTime 1515704400000

d =
Duration.diff y2019m01d11 y2018m01d11h21
in
Expect.equal d (Duration.DeltaRecord 0 11 30 3 0 0 0)
]
]


Expand Down

0 comments on commit dd5bf02

Please sign in to comment.