-
Notifications
You must be signed in to change notification settings - Fork 0
/
TestRegressions.hs
30 lines (26 loc) · 1.13 KB
/
TestRegressions.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import Data.Foldable (for_)
import System.Environment (withArgs)
import Test.Hspec
import Test.Hspec.Golden
import qualified TestTCD
import qualified TideConstituents
import qualified TideAmplitudes
import qualified TidesMain
import qualified System.IO.Fake as Fake
tests :: [(String, Fake.IO (), [String])]
tests =
[ ("TestTCD" , TestTCD.main , ["Hinkley"])
, ("TideConstituents", TideConstituents.main, ["2014"])
, ("TideAmplitudes" , TideAmplitudes.main , ["Hinkley", "2014"])
, ("Tides" , TidesMain.main , ["Hinkley", "1961-05-26 14:29", "1961-05-28 06:38", "01:26"])
, ("Tides-DST-begin" , TidesMain.main , ["Hinkley", "1960-04-09 23:00", "1960-04-10 07:00", "00:20"])
, ("Tides-DST-end" , TidesMain.main , ["Hinkley", "1960-10-01 22:00", "1960-10-02 05:00", "00:20"])
, ("Tides-YearEnd" , TidesMain.main , ["Hinkley", "2013-12-31 22:00", "2014-01-01 02:00", "00:05"])
]
main :: IO ()
main = hspec $
describe "Golden Tests" $
for_ tests $ \(file, prog, args) -> do
before (withArgs args $ Fake.execIO prog) $
specify file $
defaultGolden file