diff --git a/ocaml-calendar-timezone-test.patch b/ocaml-calendar-timezone-test.patch new file mode 100644 index 0000000..ca92b25 --- /dev/null +++ b/ocaml-calendar-timezone-test.patch @@ -0,0 +1,33 @@ +When the tests are executed in Mountain Standard Time, the timezone test fails: + +ASSERT gap g6 Local = gap g6 UTC + gap UTC Local +File "tests/test_timezone.ml", line 37, character 2: +FAIL gap g6 Local = gap g6 UTC + gap UTC Local + + Expected: `11' + Received: `-13' + +--- calendar-3.0.0/tests/test_timezone.ml.orig 2022-10-11 09:39:06.000000000 -0600 ++++ calendar-3.0.0/tests/test_timezone.ml 2024-12-13 11:20:28.349298798 -0700 +@@ -27,6 +27,12 @@ open Time_Zone;; + + let tz = Alcotest.testable (Fmt.always "timezone") (=) ;; + ++let make_in_bounds x = ++ let y = x mod 24 in ++ if y < -12 then y + 24 ++ else if y > 11 then y - 24 ++ else y ++ + let test () = + change UTC; + Alcotest.(check tz) "current () = UTC" UTC (current ()); +@@ -36,7 +42,7 @@ let test () = + let g6 = UTC_Plus 6 in + Alcotest.(check int) + "gap g6 Local = gap g6 UTC + gap UTC Local" +- (gap g6 Local) (gap g6 UTC + gap UTC Local); ++ (gap g6 Local) (make_in_bounds (gap g6 UTC + gap UTC Local)); + Gen_test.test_exn (lazy (change (UTC_Plus 13))) "change 13"; + Gen_test.test_exn (lazy (change (UTC_Plus (-15)))) "change (-15)"; + change (UTC_Plus 4); diff --git a/ocaml-calendar.spec b/ocaml-calendar.spec index 3e5fd90..1e4bb0a 100644 --- a/ocaml-calendar.spec +++ b/ocaml-calendar.spec @@ -15,13 +15,15 @@ ExcludeArch: %{ix86} Name: ocaml-calendar Epoch: 1 Version: 3.0.0 -Release: 13%{?dist} +Release: 14%{?dist} Summary: Objective Caml library for managing dates and times License: LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception URL: https://ocaml-community.github.io/calendar/ VCS: git:%{giturl}.git Source0: %{giturl}/archive/v%{version}/calendar-%{version}.tar.gz +# Work around https://github.com/ocaml-community/calendar/issues/43 +Patch: %{name}-timezone-test.patch BuildRequires: ocaml >= 4.03 BuildRequires: ocaml-dune >= 1.0 @@ -75,6 +77,10 @@ developing applications that use %{name}. %changelog +* Wed Jan 29 2025 Jerry James - 1:3.0.0-14 +- OCaml 5.2.1 rebuild for Fedora 41 +- Add patch for a test failure + * Thu Jul 18 2024 Fedora Release Engineering - 1:3.0.0-13 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild