bank-holiday-germany 2.0.1.0 → 2.1.0.0
raw patch · 3 files changed
+23/−1 lines, 3 filesdep ~timePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: time
API changes (from Hackage documentation)
Files
- CHANGELOG.md +8/−0
- bank-holiday-germany.cabal +1/−1
- test/Main.hs +14/−0
CHANGELOG.md view
@@ -4,6 +4,14 @@ and this project adheres to the [Haskell Package Versioning Policy](https://pvp.haskell.org/). +Any change that effects the number of holidays in a federal state must+be reflected a minor version increment.++## [2.1.0.0] - 2025-04-18++Increment minor version because version 2.0.1.0 changed the number of+holidays in Sachsen.+ ## [2.0.1.0] - 2025-04-17 ### Fixed
bank-holiday-germany.cabal view
@@ -1,7 +1,7 @@ cabal-version: 3.6 name: bank-holiday-germany-version: 2.0.1.0+version: 2.1.0.0 synopsis: German bank holidays and public holidays description: Calculation of bank holidays and public holidays in Germany. homepage: https://github.com/schoettl/bank-holiday-germany#readme
test/Main.hs view
@@ -23,6 +23,9 @@ year :: Day -> Year year = (\(y, _, _) -> y) . toGregorian +isSubsetOf :: Eq a => [a] -> [a] -> Bool+isSubsetOf xs ys = all (\x -> x `elem` ys) xs+ holidaysBetween' :: FederalState -> Day -> Day -> [(Day, Holiday)] holidaysBetween' state x y = filter (isFederalPublicHoliday state . snd) $ holidaysBetween x y @@ -75,6 +78,12 @@ it "the only bank holidays that are no public holidays are Chrismas Eve and New Year's Eve" $ length (filter (\x -> isBankHoliday x && not (isGermanPublicHoliday x)) [minBound..maxBound]) `shouldBe` 2+ it "holidays where isGermanPublicHoliday is true are public holidays in all federal states" $ hedgehog $ do+ y <- forAll $ Gen.integral (Range.linear 0 5000)+ let allHolidays = map snd $ holidaysBetween (fromGregorian y 1 1) (fromGregorian y 12 31)+ let allStates = [minBound..maxBound] :: [FederalState]+ all (\bundesland -> filter isGermanPublicHoliday allHolidays `isSubsetOf` filter (isFederalPublicHoliday bundesland) allHolidays) allStates+ === True describe "yearFromDay" $ do it "works for any year" $ hedgehog $ do y <- forAll $ Gen.integral (Range.linear 0 5000)@@ -155,3 +164,8 @@ describe "germanHolidayName" $ it "names are longer than 5 characters for all holidays (which mean there are no non-exhaustive patterns)" $ all ((>5) . length . germanHolidayName) [minBound .. maxBound :: Holiday] `shouldBe` True+ describe "isSubsetOf" $ do+ it "is True for simple case" $+ [1::Int] `isSubsetOf` [1,2] `shouldBe` True+ it "is False for simple case" $+ [3::Int] `isSubsetOf` [1,2] `shouldBe` False