format everything with hindent
[packages/time.git] / test / main / Test / Calendar / Easter.hs
1 module Test.Calendar.Easter
2 ( testEaster
3 ) where
4
5 import Data.Time.Calendar
6 import Data.Time.Calendar.Easter
7 import Data.Time.Format
8
9 import Test.Calendar.EasterRef
10 import Test.Tasty
11 import Test.Tasty.HUnit
12
13 --
14 days :: [Day]
15 days = [ModifiedJulianDay 53000 .. ModifiedJulianDay 53014]
16
17 showWithWDay :: Day -> String
18 showWithWDay = formatTime defaultTimeLocale "%F %A"
19
20 testEaster :: TestTree
21 testEaster =
22 testCase "testEaster" $ let
23 ds = unlines $ map (\day -> unwords [showWithWDay day, "->", showWithWDay (sundayAfter day)]) days
24 f y =
25 unwords
26 [ show y ++ ", Gregorian: moon,"
27 , show (gregorianPaschalMoon y) ++ ": Easter,"
28 , showWithWDay (gregorianEaster y)
29 ] ++
30 "\n"
31 g y =
32 unwords
33 [ show y ++ ", Orthodox : moon,"
34 , show (orthodoxPaschalMoon y) ++ ": Easter,"
35 , showWithWDay (orthodoxEaster y)
36 ] ++
37 "\n"
38 in assertEqual "" testEasterRef $ ds ++ concatMap (\y -> f y ++ g y) [2000 .. 2020]