Skip to content

Commit 423ac9b

Browse files
VenInffendor
authored andcommitted
changed other related tests
1 parent 03793d1 commit 423ac9b

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

plugins/hls-cabal-plugin/test/Completer.hs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ basicCompleterTests =
5555
doc <- openDoc "main-is.cabal" "cabal"
5656
compls <- getCompletions doc (Position 10 12)
5757
let complTexts = getTextEditTexts compls
58-
liftIO $ assertBool "suggests f2" $ "./f2.hs" `elem` complTexts
59-
liftIO $ assertBool "does not suggest" $ "./Content.hs" `notElem` complTexts
58+
liftIO $ assertBool "suggests f2" $ "f2.hs" `elem` complTexts
59+
liftIO $ assertBool "does not suggest" $ "Content.hs" `notElem` complTexts
6060
]
6161
where
6262
getTextEditTexts :: [CompletionItem] -> [T.Text]
@@ -66,21 +66,21 @@ fileCompleterTests :: TestTree
6666
fileCompleterTests =
6767
testGroup
6868
"File Completer Tests"
69-
[ testCase "Current Directory" $ do
69+
[ testCase "Current Directory - no leading ./ by default" $ do
7070
completions <- completeFilePath "" filePathComplTestDir
71-
completions @?== ["./.hidden", "./Content.hs", "./dir1/", "./dir2/", "./textfile.txt", "./main-is.cabal"],
71+
completions @?== [".hidden", "Content.hs", "dir1/", "dir2/", "textfile.txt", "main-is.cabal"],
7272
testCase "Current Directory - alternative writing" $ do
7373
completions <- completeFilePath "./" filePathComplTestDir
7474
completions @?== ["./.hidden", "./Content.hs", "./dir1/", "./dir2/", "./textfile.txt", "./main-is.cabal"],
7575
testCase "Current Directory - hidden file start" $ do
7676
completions <- completeFilePath "." filePathComplTestDir
77-
completions @?== ["./Content.hs", "./.hidden", "./textfile.txt", "./main-is.cabal"],
77+
completions @?== ["Content.hs", ".hidden", "textfile.txt", "main-is.cabal"],
7878
testCase "Current Directory - incomplete directory path written" $ do
7979
completions <- completeFilePath "di" filePathComplTestDir
80-
completions @?== ["./dir1/", "./dir2/"],
80+
completions @?== ["dir1/", "dir2/"],
8181
testCase "Current Directory - incomplete filepath written" $ do
8282
completions <- completeFilePath "te" filePathComplTestDir
83-
completions @?== ["./Content.hs", "./textfile.txt"],
83+
completions @?== ["Content.hs", "textfile.txt"],
8484
testCase "Subdirectory" $ do
8585
completions <- completeFilePath "dir1/" filePathComplTestDir
8686
completions @?== ["dir1/f1.txt", "dir1/f2.hs"],

plugins/hls-cabal-plugin/test/Context.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ pathCompletionInfoFromCompletionContextTests :: TestTree
3131
pathCompletionInfoFromCompletionContextTests =
3232
testGroup
3333
"Completion Info to Completion Context Tests"
34-
[ testCase "Current Directory" $ do
34+
[ testCase "Current Directory - no leading ./ by default" $ do
3535
let complInfo = pathCompletionInfoFromCabalPrefixInfo "" $ simpleCabalPrefixInfoFromFp "" testDataDir
36-
queryDirectory complInfo @?= "./"
36+
queryDirectory complInfo @?= ""
3737
, testCase "Current Directory - partly written next" $ do
3838
let complInfo = pathCompletionInfoFromCabalPrefixInfo "" $ simpleCabalPrefixInfoFromFp "di" testDataDir
39-
queryDirectory complInfo @?= "./"
39+
queryDirectory complInfo @?= ""
4040
pathSegment complInfo @?= "di"
4141
, testCase "Current Directory - alternative writing" $ do
4242
let complInfo = pathCompletionInfoFromCabalPrefixInfo "" $ simpleCabalPrefixInfoFromFp "./" testDataDir

0 commit comments

Comments
 (0)