From 65155e0b9a8c31875ae6c98b33048e4ee202a2f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Hr=C4=8Dek?= Date: Fri, 5 Apr 2024 17:08:12 +0200 Subject: [PATCH 1/3] Fix references to old CPP names in tests, update tests --- haskell-language-server.cabal | 4 ++++ plugins/hls-eval-plugin/test/cabal.project | 2 +- test/functional/Progress.hs | 4 ++-- test/utils/Test/Hls/Flags.hs | 8 ++++---- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 3f38abe391..2781f167bb 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -1889,6 +1889,10 @@ test-suite func-test , warnings , pedantic , refactor + , eval + , fourmolu + , ormolu + , floskell type: exitcode-stdio-1.0 build-tool-depends: haskell-language-server:haskell-language-server, diff --git a/plugins/hls-eval-plugin/test/cabal.project b/plugins/hls-eval-plugin/test/cabal.project index f0e29ace6b..3fae89fe02 100644 --- a/plugins/hls-eval-plugin/test/cabal.project +++ b/plugins/hls-eval-plugin/test/cabal.project @@ -1,3 +1,3 @@ packages: testdata/ - info-util/ + testdata/info-util/ diff --git a/test/functional/Progress.hs b/test/functional/Progress.hs index 46499e04dd..ff2cff10da 100644 --- a/test/functional/Progress.hs +++ b/test/functional/Progress.hs @@ -59,7 +59,7 @@ tests = void configurationRequest setHlsConfig (formatLspConfig "ormolu") doc <- openDoc "Format.hs" "haskell" - expectProgressMessages ["Setting up testdata (for Format.hs)", "Processing", "Indexing"] [] + expectProgressMessages ["Setting up format (for Format.hs)", "Processing", "Indexing"] [] _ <- sendRequest SMethod_TextDocumentFormatting $ DocumentFormattingParams Nothing doc (FormattingOptions 2 True Nothing Nothing Nothing) expectProgressMessages ["Formatting Format.hs"] [] , requiresFourmoluPlugin $ testCase "fourmolu plugin sends progress notifications" $ do @@ -67,7 +67,7 @@ tests = void configurationRequest setHlsConfig (formatLspConfig "fourmolu") doc <- openDoc "Format.hs" "haskell" - expectProgressMessages ["Setting up testdata (for Format.hs)", "Processing", "Indexing"] [] + expectProgressMessages ["Setting up format (for Format.hs)", "Processing", "Indexing"] [] _ <- sendRequest SMethod_TextDocumentFormatting $ DocumentFormattingParams Nothing doc (FormattingOptions 2 True Nothing Nothing Nothing) expectProgressMessages ["Formatting Format.hs"] [] ] diff --git a/test/utils/Test/Hls/Flags.hs b/test/utils/Test/Hls/Flags.hs index 7ff17af076..8e60ebb93e 100644 --- a/test/utils/Test/Hls/Flags.hs +++ b/test/utils/Test/Hls/Flags.hs @@ -10,7 +10,7 @@ import Test.Hls (TestTree, ignoreTestBecause) -- | Disable test unless the eval flag is set requiresEvalPlugin :: TestTree -> TestTree -#if eval +#if hls_eval requiresEvalPlugin = id #else requiresEvalPlugin = ignoreTestBecause "Eval plugin disabled" @@ -19,7 +19,7 @@ requiresEvalPlugin = ignoreTestBecause "Eval plugin disabled" -- * Formatters -- | Disable test unless the floskell flag is set requiresFloskellPlugin :: TestTree -> TestTree -#if floskell +#if hls_floskell requiresFloskellPlugin = id #else requiresFloskellPlugin = ignoreTestBecause "Floskell plugin disabled" @@ -27,7 +27,7 @@ requiresFloskellPlugin = ignoreTestBecause "Floskell plugin disabled" -- | Disable test unless the fourmolu flag is set requiresFourmoluPlugin :: TestTree -> TestTree -#if fourmolu +#if hls_fourmolu requiresFourmoluPlugin = id #else requiresFourmoluPlugin = ignoreTestBecause "Fourmolu plugin disabled" @@ -35,7 +35,7 @@ requiresFourmoluPlugin = ignoreTestBecause "Fourmolu plugin disabled" -- | Disable test unless the ormolu flag is set requiresOrmoluPlugin :: TestTree -> TestTree -#if ormolu +#if hls_ormolu requiresOrmoluPlugin = id #else requiresOrmoluPlugin = ignoreTestBecause "Ormolu plugin disabled" From 964c3e4ba94f8fe28072a9671e707ce39150f6fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Hr=C4=8Dek?= Date: Fri, 5 Apr 2024 17:31:30 +0200 Subject: [PATCH 2/3] Remove redundant common stanza imports --- haskell-language-server.cabal | 4 ---- 1 file changed, 4 deletions(-) diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 2781f167bb..3f38abe391 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -1889,10 +1889,6 @@ test-suite func-test , warnings , pedantic , refactor - , eval - , fourmolu - , ormolu - , floskell type: exitcode-stdio-1.0 build-tool-depends: haskell-language-server:haskell-language-server, From 5faaeea658787fbc0a5ce87362efb647a53bccbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Hr=C4=8Dek?= Date: Sat, 6 Apr 2024 16:39:13 +0200 Subject: [PATCH 3/3] Remove expectation of Indexing associated with unrelated test file --- test/functional/Progress.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional/Progress.hs b/test/functional/Progress.hs index ff2cff10da..57fea1674f 100644 --- a/test/functional/Progress.hs +++ b/test/functional/Progress.hs @@ -37,7 +37,7 @@ tests = (codeLensResponse, activeProgressTokens) <- expectProgressMessagesTill (responseForId SMethod_TextDocumentCodeLens lspId) - ["Setting up testdata (for T1.hs)", "Processing", "Indexing"] + ["Setting up testdata (for T1.hs)", "Processing"] [] -- this is a test so exceptions result in fails