Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Commit 1a57c7b

Browse files
committed
Fix lint unit tests
1 parent afe8ba8 commit 1a57c7b

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

test/unit/ApplyRefactPluginSpec.hs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ applyRefactSpec = do
6767

6868
it "returns hints as diagnostics" $ do
6969

70-
let act = lint arg
71-
arg = applyRefactPath
70+
let act = lint applyRefactPath
7271
res = IdeResultOk
7372
PublishDiagnosticsParams
7473
{ _uri = applyRefactPath
@@ -86,16 +85,15 @@ applyRefactSpec = do
8685
"Redundant bracket\nFound:\n (x + 1)\nWhy not:\n x + 1\n"
8786
Nothing
8887
]}
89-
testCommand testPlugins act "applyrefact" "lint" arg res
88+
runIGM testPlugins act `shouldReturn` res
9089

9190
-- ---------------------------------
9291

9392
it "returns hlint parse error as DsInfo ignored diagnostic" $ do
9493
filePathNoUri <- makeAbsolute "./test/testdata/HlintParseFail.hs"
9594
let filePath = filePathToUri filePathNoUri
9695

97-
let act = lint arg
98-
arg = filePath
96+
let act = lint filePath
9997
res = IdeResultOk
10098
PublishDiagnosticsParams
10199
{ _uri = filePath
@@ -107,7 +105,7 @@ applyRefactSpec = do
107105
, _source = Just "hlint"
108106
, _message = T.pack filePathNoUri <> ":13:24: error:\n Operator applied to too few arguments: +\n data instance Sing (z :: (a :~: b)) where\n> SRefl :: Sing Refl +\n\n"
109107
, _relatedInformation = Nothing }]}
110-
testCommand testPlugins act "applyrefact" "lint" arg res
108+
runIGM testPlugins act `shouldReturn` res
111109

112110
-- ---------------------------------
113111

0 commit comments

Comments
 (0)