summaryrefslogtreecommitdiff
path: root/test/test_date_time.ml
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_date_time.ml')
-rw-r--r--test/test_date_time.ml9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/test_date_time.ml b/test/test_date_time.ml
index 6f58b1e..89286b8 100644
--- a/test/test_date_time.ml
+++ b/test/test_date_time.ml
@@ -151,7 +151,11 @@ let round_trips =
let (_, (_, tz_offset_s) as dt) = rand_date_time_stamp () in
let stamp = stamp_of_date_time dt in
if not (is_leap_sec dt)
- then eq_date_time dt (Ptime.to_date_time ~tz_offset_s stamp)
+ then begin
+ let ((y, _, _), _ as dt') = Ptime.to_date_time ~tz_offset_s stamp in
+ assert (Ptime.to_year ~tz_offset_s stamp = y);
+ eq_date_time dt dt'
+ end
else begin
(* Verify we map the leap sec on the the second after. *)
let before_leap_dt = match dt with
@@ -165,7 +169,8 @@ let round_trips =
()
let weekday =
- test "Ptime.weekday" @@ fun () ->
+ test "Ptime.{weekday_num,weekday}" @@ fun () ->
+ (* weekday tests weekday_num *)
let pp_weekday ppf v = Format.pp_print_string ppf begin match v with
| `Mon -> "`Mon" | `Tue -> "`Tue" | `Wed -> "`Wed" | `Thu -> "`Thu"
| `Fri -> "`Fri" | `Sat -> "`Sat" | `Sun -> "`Sun"