Skip to content

Commit 5a28bd8

Browse files
committed
add test
1 parent d61fe2c commit 5a28bd8

File tree

9 files changed

+247
-209
lines changed

9 files changed

+247
-209
lines changed

ghcide/ghcide.cabal

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,6 @@ test-suite ghcide-tests
387387
LogType
388388
NonLspCommandLine
389389
OpenCloseTest
390-
OutlineTests
391390
PluginSimpleTests
392391
PositionMappingTests
393392
PreprocessorTests

ghcide/test/exe/Main.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ main = do
9696
, CPPTests.tests
9797
, DiagnosticTests.tests
9898
, CodeLensTests.tests
99-
, OutlineTests.tests
10099
, HighlightTests.tests
101100
, FindDefinitionAndHoverTests.tests
102101
, PluginSimpleTests.tests

ghcide/test/exe/OutlineTests.hs

Lines changed: 0 additions & 189 deletions
This file was deleted.

haskell-language-server.cabal

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,6 +1660,9 @@ test-suite hls-core-plugin-tests
16601660
main-is: CoreTest.hs
16611661
other-modules:
16621662
InitializeResponseTests
1663+
OutlineTests
1664+
Util
1665+
16631666

16641667
build-depends:
16651668
, aeson

plugins/hls-core-plugin/src/Ide/Plugin/Core.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ descriptor recorder plId =
4949
gotoTypeDefinition ide TextDocumentPositionParams{..})
5050
<> mkPluginHandler SMethod_TextDocumentDocumentHighlight (\ide _ DocumentHighlightParams{..} ->
5151
documentHighlight ide TextDocumentPositionParams{..})
52-
<> mkPluginHandler SMethod_TextDocumentHover hover'
53-
<> mkPluginHandler SMethod_WorkspaceSymbol (wsSymbols recorder)
54-
<> mkPluginHandler SMethod_TextDocumentReferences references
52+
<> mkPluginHandler SMethod_TextDocumentHover hover'
53+
<> mkPluginHandler SMethod_WorkspaceSymbol (wsSymbols recorder)
54+
<> mkPluginHandler SMethod_TextDocumentReferences references
5555
}
5656

5757

plugins/hls-core-plugin/test/CoreTest.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
{-# LANGUAGE OverloadedStrings #-}
44

55
import qualified InitializeResponseTests
6+
import qualified OutlineTests
67
import Test.Hls (defaultTestRunner, testGroup)
78

89

@@ -11,4 +12,6 @@ main =
1112
defaultTestRunner $
1213
testGroup
1314
"core"
14-
[ InitializeResponseTests.tests ]
15+
[ InitializeResponseTests.tests
16+
, OutlineTests.tests
17+
]

plugins/hls-core-plugin/test/exe/InitializeResponseTests.hs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import Development.IDE.Plugin.TypeLenses (typeLensCommandId)
1313
import qualified Language.LSP.Protocol.Lens as L
1414
import Language.LSP.Protocol.Message
1515
import Language.LSP.Test
16+
import Util
1617

1718
import Control.Lens ((^.))
1819
import Data.Default (def)
@@ -46,9 +47,6 @@ import Test.Hls.FileSystem (file, text)
4647
import Test.Tasty
4748
import Test.Tasty.HUnit
4849

49-
corePlugin :: PluginTestDescriptor Core.CoreLog
50-
corePlugin = mkPluginTestDescriptor Core.descriptor "core"
51-
5250
tests :: TestTree
5351
tests = withResource acquire release tests where
5452

@@ -125,15 +123,4 @@ tests = withResource acquire release tests where
125123
release :: TResponseMessage Method_Initialize -> IO ()
126124
release = mempty
127125

128-
directFile :: FilePath -> Text -> [FS.FileTree]
129-
directFile fp content =
130-
[ FS.directCradle [Text.pack fp]
131-
, file fp (text content)
132-
]
133-
134-
mkFs :: [FS.FileTree] -> FS.VirtualFileTree
135-
mkFs = FS.mkVirtualFileTree testDataDir
136-
137-
testDataDir :: FilePath
138-
testDataDir = "plugins" </> "core-plugin" </> "test" </> "testdata"
139126

0 commit comments

Comments
 (0)