on master help sign in
WIP: tutd notification test
commit677dc7d4c27e88fb65c0d2b1b1493707d7d86c28 authorAgentM <agentm@themactionfaction.com> dateWed 27 Jan 2016, 22:12 (11 years ago) parent93b859d
1 file changed+9−4
test/TutorialD/Interpreter.hs+9−4
test/TutorialD/Interpreter.hs+9−4
@@ -242,9 +242,9 @@ inclusionDependencies (InProcessConnection (DisconnectedTransaction _ context))
242242inclusionDependencies _ = error "remote connection used"
243243-}
244244
245−dateExamplesConnection :: IO (SessionId, Connection)
246−dateExamplesConnection = do
247− dbconn <- connectProjectM36 (InProcessConnectionInfo NoPersistence emptyNotificationCallback)
245+dateExamplesConnection :: NotificationCallback -> IO (SessionId, Connection)
246+dateExamplesConnection callback = do
247+ dbconn <- connectProjectM36 (InProcessConnectionInfo NoPersistence callback)
248248 let incDeps = Base.inclusionDependencies dateExamples
249249 case dbconn of
250250 Left err -> error (show err)
@@ -258,5 +258,10 @@ dateExamplesConnection = do
258258 --skipping atom functions for now- there are no atom function manipulation operators yet
259259 commit sessionId conn >>= maybeFail
260260 pure (sessionId, conn)
261−
262261
262+-- test notifications over the InProcessConnection
263+testNotification :: Test
264+testNotification = TestCase $ do
265+ notifmvar <- newEmptyMVar
266+ let notifCallback mvar = putMVar mvar ()
267+ conn <- dateExamplesConnection