Skip to content

Commit

Permalink
Remove weird test
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelpj committed Jun 20, 2023
1 parent cfb80be commit 88f0381
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions test/functional/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,38 +27,16 @@ import qualified Language.LSP.Protocol.Lens as L
import Language.LSP.Test as Test
import System.FilePath ((</>))
import Test.Hls
import Test.Hls.Command

{-# ANN module ("HLint: ignore Reduce duplication"::String) #-}

tests :: TestTree
tests = testGroup "plugin config" [
-- Note: there are more comprehensive tests over config in hls-hlint-plugin
-- TODO: Add generic tests over some example plugin
configParsingTests, genericConfigTests
genericConfigTests
]

configParsingTests :: TestTree
configParsingTests = testGroup "config parsing"
[ testCase "empty object as user configuration should not send error logMessage" $ runConfigSession "" $ do
let config = object []
sendConfigurationChanged (toJSON config)

-- Send custom request so server returns a response to prevent blocking
void $ sendNotification (SMethod_CustomMethod (Proxy @"non-existent-method")) Null

logNot <- skipManyTill Test.anyMessage (message SMethod_WindowLogMessage)

liftIO $ (logNot ^. L.params . L.type_) > MessageType_Error
|| "non-existent-method" `T.isInfixOf` (logNot ^. L.params . L.message)
@? "Server sends logMessage with MessageType = Error"
]

where
runConfigSession :: FilePath -> Session a -> IO a
runConfigSession subdir =
failIfSessionTimeout . runSession hlsCommand fullCaps ("test/testdata" </> subdir)

genericConfigTests :: TestTree
genericConfigTests = testGroup "generic plugin config"
[
Expand Down

0 comments on commit 88f0381

Please sign in to comment.