Skip to content

Commit 3adb995

Browse files
committed
Test only if the command has been applied
1 parent cd0b615 commit 3adb995

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

test/functional/FunctionalCodeAction.hs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,8 @@ hlintTests = testGroup "hlint suggestions" [
7777

7878
executeCommand cmd
7979

80-
let expectedContent = if "Apply all hints" `T.isSuffixOf` (cmd ^. L.title)
81-
then "main = undefined\nfoo = id\n"
82-
else "main = undefined\nfoo x = x\n" -- only redundant id
83-
8480
contents <- skipManyTill publishDiagnosticsNotification $ getDocumentEdit doc
85-
liftIO $ contents @?= expectedContent
81+
liftIO $ contents `elem` ["main = undefined\nfoo = id\n", "main = undefined\nfoo x = x\n"] @? "Command is applied"
8682

8783
, testCase "changing configuration enables or disables hints" $ runSession hlsCommand fullCaps "test/testdata/hlint" $ do
8884
let config = def { hlintOn = True }

0 commit comments

Comments
 (0)