@@ -2055,8 +2055,8 @@ testAsyncCommands sqSecured alice bob baseId =
20552055 ackMessageAsync alice " 7" bobId (baseId + 4 ) Nothing
20562056 get alice =##> \ case (" 7" , _, OK ) -> True ; _ -> False
20572057 deleteConnectionAsync alice False bobId
2058- get alice =##> \ case (" " , c, DEL_RCVQ _ _ Nothing ) -> c == bobId; _ -> False
2059- get alice =##> \ case (" " , c, DEL_CONN ) -> c == bobId; _ -> False
2058+ get alice =##> \ case (" " , " " , DEL_RCVQS [(c, _, _, Nothing )] ) -> c == bobId; _ -> False
2059+ get alice =##> \ case (" " , " " , DEL_CONNS [c] ) -> c == bobId; _ -> False
20602060 liftIO $ noMessages alice " nothing else should be delivered to alice"
20612061 where
20622062 msgId = subtract baseId
@@ -2123,12 +2123,9 @@ testDeleteConnectionAsync t =
21232123 runRight_ $ do
21242124 deleteConnectionsAsync a False connIds
21252125 nGet a =##> \ case (" " , " " , DOWN {}) -> True ; _ -> False
2126- get a =##> \ case (" " , c, DEL_RCVQ _ _ (Just (BROKER _ e))) -> c `elem` connIds && (e == TIMEOUT || e == NETWORK ); _ -> False
2127- get a =##> \ case (" " , c, DEL_RCVQ _ _ (Just (BROKER _ e))) -> c `elem` connIds && (e == TIMEOUT || e == NETWORK ); _ -> False
2128- get a =##> \ case (" " , c, DEL_RCVQ _ _ (Just (BROKER _ e))) -> c `elem` connIds && (e == TIMEOUT || e == NETWORK ); _ -> False
2129- get a =##> \ case (" " , c, DEL_CONN ) -> c `elem` connIds; _ -> False
2130- get a =##> \ case (" " , c, DEL_CONN ) -> c `elem` connIds; _ -> False
2131- get a =##> \ case (" " , c, DEL_CONN ) -> c `elem` connIds; _ -> False
2126+ let delOk = \ case (c, _, _, Just (BROKER _ e)) -> c `elem` connIds && (e == TIMEOUT || e == NETWORK ); _ -> False
2127+ get a =##> \ case (" " , " " , DEL_RCVQS rs) -> length rs == 3 && all delOk rs; _ -> False
2128+ get a =##> \ case (" " , " " , DEL_CONNS cs) -> length cs == 3 && all (`elem` connIds) cs; _ -> False
21322129 liftIO $ noMessages a " nothing else should be delivered to alice"
21332130
21342131testWaitDeliveryNoPending :: ATransport -> IO ()
@@ -2147,8 +2144,8 @@ testWaitDeliveryNoPending t = withAgentClients2 $ \alice bob ->
21472144 ackMessage alice bobId (baseId + 2 ) Nothing
21482145
21492146 deleteConnectionsAsync alice True [bobId]
2150- get alice =##> \ case (" " , cId, DEL_RCVQ _ _ Nothing ) -> cId == bobId; _ -> False
2151- get alice =##> \ case (" " , cId, DEL_CONN ) -> cId == bobId; _ -> False
2147+ get alice =##> \ case (" " , " " , DEL_RCVQS [(cId, _, _, Nothing )] ) -> cId == bobId; _ -> False
2148+ get alice =##> \ case (" " , " " , DEL_CONNS [cId] ) -> cId == bobId; _ -> False
21522149
21532150 3 <- msgId <$> sendMessage bob aliceId SMP. noMsgFlags " message 2"
21542151 get bob =##> \ case (" " , cId, MERR mId (SMP _ AUTH )) -> cId == aliceId && mId == (baseId + 3 ); _ -> False
@@ -2184,14 +2181,14 @@ testWaitDelivery t =
21842181 3 <- msgId <$> sendMessage alice bobId SMP. noMsgFlags " how are you?"
21852182 4 <- msgId <$> sendMessage alice bobId SMP. noMsgFlags " message 1"
21862183 deleteConnectionsAsync alice True [bobId]
2187- get alice =##> \ case (" " , cId, DEL_RCVQ _ _ ( Just (BROKER _ e))) -> cId == bobId && (e == TIMEOUT || e == NETWORK ); _ -> False
2184+ get alice =##> \ case (" " , " " , DEL_RCVQS [(cId, _, _, Just (BROKER _ e))] ) -> cId == bobId && (e == TIMEOUT || e == NETWORK ); _ -> False
21882185 liftIO $ noMessages alice " nothing else should be delivered to alice"
21892186 liftIO $ noMessages bob " nothing else should be delivered to bob"
21902187
21912188 withSmpServerStoreLogOn t testPort $ \ _ -> runRight_ $ do
21922189 get alice ##> (" " , bobId, SENT $ baseId + 3 )
21932190 get alice ##> (" " , bobId, SENT $ baseId + 4 )
2194- get alice =##> \ case (" " , cId, DEL_CONN ) -> cId == bobId; _ -> False
2191+ get alice =##> \ case (" " , " " , DEL_CONNS [cId] ) -> cId == bobId; _ -> False
21952192
21962193 liftIO $
21972194 getInAnyOrder
@@ -2231,8 +2228,8 @@ testWaitDeliveryAUTHErr t =
22312228 ackMessage alice bobId (baseId + 2 ) Nothing
22322229
22332230 deleteConnectionsAsync bob False [aliceId]
2234- get bob =##> \ case (" " , cId, DEL_RCVQ _ _ Nothing ) -> cId == aliceId; _ -> False
2235- get bob =##> \ case (" " , cId, DEL_CONN ) -> cId == aliceId; _ -> False
2231+ get bob =##> \ case (" " , " " , DEL_RCVQS [(cId, _, _, Nothing )] ) -> cId == aliceId; _ -> False
2232+ get bob =##> \ case (" " , " " , DEL_CONNS [cId] ) -> cId == aliceId; _ -> False
22362233
22372234 pure (aliceId, bobId)
22382235
@@ -2241,14 +2238,14 @@ testWaitDeliveryAUTHErr t =
22412238 3 <- msgId <$> sendMessage alice bobId SMP. noMsgFlags " how are you?"
22422239 4 <- msgId <$> sendMessage alice bobId SMP. noMsgFlags " message 1"
22432240 deleteConnectionsAsync alice True [bobId]
2244- get alice =##> \ case (" " , cId, DEL_RCVQ _ _ ( Just (BROKER _ e))) -> cId == bobId && (e == TIMEOUT || e == NETWORK ); _ -> False
2241+ get alice =##> \ case (" " , " " , DEL_RCVQS [(cId, _, _, Just (BROKER _ e))] ) -> cId == bobId && (e == TIMEOUT || e == NETWORK ); _ -> False
22452242 liftIO $ noMessages alice " nothing else should be delivered to alice"
22462243 liftIO $ noMessages bob " nothing else should be delivered to bob"
22472244
22482245 withSmpServerStoreLogOn t testPort $ \ _ -> do
22492246 get alice =##> \ case (" " , cId, MERR mId (SMP _ AUTH )) -> cId == bobId && mId == (baseId + 3 ); _ -> False
22502247 get alice =##> \ case (" " , cId, MERR mId (SMP _ AUTH )) -> cId == bobId && mId == (baseId + 4 ); _ -> False
2251- get alice =##> \ case (" " , cId, DEL_CONN ) -> cId == bobId; _ -> False
2248+ get alice =##> \ case (" " , " " , DEL_CONNS [cId] ) -> cId == bobId; _ -> False
22522249
22532250 liftIO $ noMessages alice " nothing else should be delivered to alice"
22542251 liftIO $ noMessages bob " nothing else should be delivered to bob"
@@ -2281,8 +2278,8 @@ testWaitDeliveryTimeout t =
22812278 3 <- msgId <$> sendMessage alice bobId SMP. noMsgFlags " how are you?"
22822279 4 <- msgId <$> sendMessage alice bobId SMP. noMsgFlags " message 1"
22832280 deleteConnectionsAsync alice True [bobId]
2284- get alice =##> \ case (" " , cId, DEL_RCVQ _ _ ( Just (BROKER _ e))) -> cId == bobId && (e == TIMEOUT || e == NETWORK ); _ -> False
2285- get alice =##> \ case (" " , cId, DEL_CONN ) -> cId == bobId; _ -> False
2281+ get alice =##> \ case (" " , " " , DEL_RCVQS [(cId, _, _, Just (BROKER _ e))] ) -> cId == bobId && (e == TIMEOUT || e == NETWORK ); _ -> False
2282+ get alice =##> \ case (" " , " " , DEL_CONNS [cId] ) -> cId == bobId; _ -> False
22862283 liftIO $ noMessages alice " nothing else should be delivered to alice"
22872284 liftIO $ noMessages bob " nothing else should be delivered to bob"
22882285
@@ -2321,8 +2318,8 @@ testWaitDeliveryTimeout2 t =
23212318 3 <- msgId <$> sendMessage alice bobId SMP. noMsgFlags " how are you?"
23222319 4 <- msgId <$> sendMessage alice bobId SMP. noMsgFlags " message 1"
23232320 deleteConnectionsAsync alice True [bobId]
2324- get alice =##> \ case (" " , cId, DEL_RCVQ _ _ ( Just (BROKER _ e))) -> cId == bobId && (e == TIMEOUT || e == NETWORK ); _ -> False
2325- get alice =##> \ case (" " , cId, DEL_CONN ) -> cId == bobId; _ -> False
2321+ get alice =##> \ case (" " , " " , DEL_RCVQS [(cId, _, _, Just (BROKER _ e))] ) -> cId == bobId && (e == TIMEOUT || e == NETWORK ); _ -> False
2322+ get alice =##> \ case (" " , " " , DEL_CONNS [cId] ) -> cId == bobId; _ -> False
23262323 liftIO $ noMessages alice " nothing else should be delivered to alice"
23272324 liftIO $ noMessages bob " nothing else should be delivered to bob"
23282325
@@ -2430,8 +2427,8 @@ testUsers =
24302427 (aId', bId') <- makeConnectionForUsers a auId b 1
24312428 exchangeGreetings a bId' b aId'
24322429 deleteUser a auId True
2433- get a =##> \ case (" " , c, DEL_RCVQ _ _ Nothing ) -> c == bId'; _ -> False
2434- get a =##> \ case (" " , c, DEL_CONN ) -> c == bId'; _ -> False
2430+ get a =##> \ case (" " , " " , DEL_RCVQS [(c, _, _, Nothing )] ) -> c == bId'; _ -> False
2431+ get a =##> \ case (" " , " " , DEL_CONNS [c] ) -> c == bId'; _ -> False
24352432 nGet a =##> \ case (" " , " " , DEL_USER u) -> u == auId; _ -> False
24362433 exchangeGreetingsMsgId 4 a bId b aId
24372434 liftIO $ noMessages a " nothing else should be delivered to alice"
@@ -2462,8 +2459,8 @@ testUsersNoServer t = withAgentClientsCfg2 aCfg agentCfg $ \a b -> do
24622459 nGet b =##> \ case (" " , " " , DOWN _ cs) -> length cs == 2 ; _ -> False
24632460 runRight_ $ do
24642461 deleteUser a auId True
2465- get a =##> \ case (" " , c, DEL_RCVQ _ _ ( Just (BROKER _ e))) -> c == bId' && (e == TIMEOUT || e == NETWORK ); _ -> False
2466- get a =##> \ case (" " , c, DEL_CONN ) -> c == bId'; _ -> False
2462+ get a =##> \ case (" " , " " , DEL_RCVQS [(c, _, _, Just (BROKER _ e))] ) -> c == bId' && (e == TIMEOUT || e == NETWORK ); _ -> False
2463+ get a =##> \ case (" " , " " , DEL_CONNS [c] ) -> c == bId'; _ -> False
24672464 nGet a =##> \ case (" " , " " , DEL_USER u) -> u == auId; _ -> False
24682465 liftIO $ noMessages a " nothing else should be delivered to alice"
24692466 withSmpServerStoreLogOn t testPort $ \ _ -> runRight_ $ do
@@ -2581,9 +2578,8 @@ testSwitchDelete servers =
25812578 liftIO $ rcvSwchStatuses' stats `shouldMatchList` [Just RSSwitchStarted ]
25822579 phaseRcv a bId SPStarted [Just RSSendingQADD , Nothing ]
25832580 deleteConnectionAsync a False bId
2584- get a =##> \ case (" " , c, DEL_RCVQ _ _ Nothing ) -> c == bId; _ -> False
2585- get a =##> \ case (" " , c, DEL_RCVQ _ _ Nothing ) -> c == bId; _ -> False
2586- get a =##> \ case (" " , c, DEL_CONN ) -> c == bId; _ -> False
2581+ get a =##> \ case (" " , " " , DEL_RCVQS [(c, _, _, Nothing ), (c', _, _, Nothing )]) -> c == bId && c' == bId; _ -> False
2582+ get a =##> \ case (" " , " " , DEL_CONNS [c]) -> c == bId; _ -> False
25872583 liftIO $ noMessages a " nothing else should be delivered to alice"
25882584
25892585testAbortSwitchStarted :: HasCallStack => InitialAgentServers -> IO ()
0 commit comments