Skip to content

Commit

Permalink
hls-notes-plugin: Fix tests on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
jvanbruegge committed Feb 28, 2024
1 parent abcf822 commit e2d3c2f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions plugins/hls-notes-plugin/test/NotesTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Development.IDE.Test
import Ide.Plugin.Notes (Log, descriptor)
import System.Directory (canonicalizePath)
import System.FilePath ((</>))
import Test.Hls
import Test.Hls hiding (waitForBuildQueue)

plugin :: PluginTestDescriptor Log
plugin = mkPluginTestDescriptor descriptor "notes"
Expand All @@ -19,15 +19,15 @@ gotoNoteTests :: TestTree
gotoNoteTests = testGroup "Goto Note Definition"
[ testCase "single_file" $ runSessionWithServer def plugin testDataDir $ do
doc <- openDoc "NoteDef.hs" "haskell"
waitForCustomMessage "ghcide/cradle/loaded" (const $ Just ())
waitForBuildQueue
waitForAllProgressDone
defs <- getDefinitions doc (Position 3 41)
liftIO $ do
fp <- canonicalizePath "NoteDef.hs"
defs @?= InL (Definition (InR [Location (filePathToUri fp) (Range (Position 8 9) (Position 8 9))]))
, testCase "liberal_format" $ runSessionWithServer def plugin testDataDir $ do
doc <- openDoc "NoteDef.hs" "haskell"
waitForCustomMessage "ghcide/cradle/loaded" (const $ Just ())
waitForBuildQueue
waitForAllProgressDone
defs <- getDefinitions doc (Position 5 64)
liftIO $ do
Expand All @@ -36,22 +36,23 @@ gotoNoteTests = testGroup "Goto Note Definition"

, testCase "invalid_note" $ runSessionWithServer def plugin testDataDir $ do
doc <- openDoc "NoteDef.hs" "haskell"
waitForCustomMessage "ghcide/cradle/loaded" (const $ Just ())
waitForBuildQueue
waitForAllProgressDone
defs <- getDefinitions doc (Position 6 54)
liftIO $ do
defs @?= InL (Definition (InR []))

, testCase "no_note" $ runSessionWithServer def plugin testDataDir $ do
doc <- openDoc "NoteDef.hs" "haskell"
waitForCustomMessage "ghcide/cradle/loaded" (const $ Just ())
waitForBuildQueue
waitForAllProgressDone
defs <- getDefinitions doc (Position 1 0)
liftIO $ defs @?= InL (Definition (InR []))

, testCase "unopened_file" $ runSessionWithServer def plugin testDataDir $ do
doc <- openDoc "Other.hs" "haskell"
waitForCustomMessage "ghcide/cradle/loaded" (const $ Just ())
waitForBuildQueue
waitForAllProgressDone
defs <- getDefinitions doc (Position 5 20)
liftIO $ do
Expand Down

0 comments on commit e2d3c2f

Please sign in to comment.