@@ -16,6 +16,7 @@ import TutorialD.Interpreter.DatabaseContextExpr
1616import qualified Data.Map as M
1717import qualified Data.Set as S
1818import Data.Time.Clock
19+import Data.Time.Calendar
1920
2021main :: IO ()
2122main = do
@@ -27,12 +28,15 @@ testList = TestList [testBootstrapDB,
2728 testDBSimplePersistence,
2829 testFunctionPersistence]
2930
31+stamp :: UTCTime
32+stamp = UTCTime (fromGregorian 1980 01 01) (secondsToDiffTime 1000)
33+
3034{- bootstrap a database, ensure that it can be read -}
3135testBootstrapDB :: Test
3236testBootstrapDB = TestCase $ withSystemTempDirectory "m36testdb" $ \tempdir -> do
3337 let dbdir = tempdir </> "dbdir"
3438 freshId <- nextRandom
35− stamp <- getCurrentTime
39+
3640 _ <- bootstrapDatabaseDir NoDiskSync dbdir (bootstrapTransactionGraph stamp freshId dateExamples)
3741 loadedGraph <- transactionGraphLoad dbdir emptyTransactionGraph Nothing
3842 assertBool "transactionGraphLoad" $ isRight loadedGraph
@@ -42,7 +46,7 @@ testDBSimplePersistence :: Test
4246testDBSimplePersistence = TestCase $ withSystemTempDirectory "m36testdb" $ \tempdir -> do
4347 let dbdir = tempdir </> "dbdir"
4448 freshId <- nextRandom
45− stamp <- getCurrentTime
49+
4650 let graph = bootstrapTransactionGraph stamp freshId dateExamples
4751 _ <- bootstrapDatabaseDir NoDiskSync dbdir graph
4852 case transactionForHead "master" graph of