Skip to content

Commit 5c2cf2f

Browse files
committed
fix client settings test
1 parent 794a48f commit 5c2cf2f

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

ghcide/test/exe/Main.hs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4997,18 +4997,16 @@ clientSettingsTest :: TestTree
49974997
clientSettingsTest = testGroup "client settings handling"
49984998
[ testSession "ghcide restarts shake session on config changes" $ do
49994999
void $ skipManyTill anyMessage $ message SClientRegisterCapability
5000+
waitForProgressDone
50005001
sendNotification SWorkspaceDidChangeConfiguration (DidChangeConfigurationParams (toJSON ("" :: String)))
5001-
nots <- skipManyTill anyMessage $ count 3 loggingNotification
5002-
isMessagePresent "Restarting build session" (map getLogMessage nots)
5002+
skipManyTill anyMessage restartingBuildSession
50035003

50045004
]
5005-
where getLogMessage :: FromServerMessage -> T.Text
5006-
getLogMessage (FromServerMess SWindowLogMessage (NotificationMessage _ _ (LogMessageParams _ msg))) = msg
5007-
getLogMessage _ = ""
5008-
5009-
isMessagePresent expectedMsg actualMsgs = liftIO $
5010-
assertBool ("\"" ++ expectedMsg ++ "\" is not present in: " ++ show actualMsgs)
5011-
(any ((expectedMsg `isSubsequenceOf`) . show) actualMsgs)
5005+
where
5006+
restartingBuildSession :: Session ()
5007+
restartingBuildSession = do
5008+
FromServerMess SWindowLogMessage NotificationMessage{_params = LogMessageParams{..}} <- loggingNotification
5009+
guard $ "Restarting build session" `T.isInfixOf` _message
50125010

50135011
referenceTests :: TestTree
50145012
referenceTests = testGroup "references"

0 commit comments

Comments
 (0)