Skip to content

Commit fb9dbc7

Browse files
committed
fix command capability check
1 parent c276978 commit fb9dbc7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ghcide/test/exe/Main.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ initializeResponseTests = withResource acquire release tests where
142142
, chk "NO doc link" _documentLinkProvider Nothing
143143
, chk "NO color" _colorProvider (Just $ ColorOptionsStatic False)
144144
, chk "NO folding range" _foldingRangeProvider (Just $ FoldingRangeOptionsStatic False)
145-
, che " execute command" _executeCommandProvider (Just $ ExecuteCommandOptions $ List [typeLensCommandId, blockCommandId])
145+
, che " execute command" _executeCommandProvider [blockCommandId, typeLensCommandId]
146146
, chk " workspace" _workspace (Just $ WorkspaceOptions (Just WorkspaceFolderOptions{_supported = Just True, _changeNotifications = Just ( WorkspaceFolderChangeNotificationsBool True )}))
147147
, chk "NO experimental" _experimental Nothing
148148
] where
@@ -158,13 +158,13 @@ initializeResponseTests = withResource acquire release tests where
158158
chk title getActual expected =
159159
testCase title $ getInitializeResponse >>= \ir -> expected @=? (getActual . innerCaps) ir
160160

161-
che :: TestName -> (InitializeResponseCapabilitiesInner -> Maybe ExecuteCommandOptions) -> Maybe ExecuteCommandOptions -> TestTree
162-
che title getActual _expected = testCase title doTest
161+
che :: TestName -> (InitializeResponseCapabilitiesInner -> Maybe ExecuteCommandOptions) -> [T.Text] -> TestTree
162+
che title getActual expected = testCase title doTest
163163
where
164164
doTest = do
165165
ir <- getInitializeResponse
166-
let Just ExecuteCommandOptions {_commands = List [command]} = getActual $ innerCaps ir
167-
True @=? T.isSuffixOf "typesignature.add" command
166+
let Just ExecuteCommandOptions {_commands = List commands} = getActual $ innerCaps ir
167+
zipWithM_ (\e o -> T.isSuffixOf e o @? show (e,o)) expected commands
168168

169169

170170
innerCaps :: InitializeResponse -> InitializeResponseCapabilitiesInner

0 commit comments

Comments
 (0)