From 79ded0c28acb32e070e9c7679565f78a2a55ffb9 Mon Sep 17 00:00:00 2001 From: jneira Date: Thu, 4 Jul 2019 07:31:43 +0200 Subject: [PATCH 1/3] Clear out pattern matching and error message of executeCodeActionByName --- test/functional/FunctionalCodeActionsSpec.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/functional/FunctionalCodeActionsSpec.hs b/test/functional/FunctionalCodeActionsSpec.hs index f25345d88..f029cafe1 100644 --- a/test/functional/FunctionalCodeActionsSpec.hs +++ b/test/functional/FunctionalCodeActionsSpec.hs @@ -751,11 +751,11 @@ hsImportSpec formatterName [e1, e2, e3, e4] = let actions = filter (\actn -> actn ^. L.title `elem` names) allActions case actions of (action:_) -> executeCodeAction action - xs -> + [] -> error - $ "Found an unexpected amount of action. Expected 1, but got: " - ++ show (length xs) - ++ ".\n Titles: " ++ show (map (^. L.title) allActions) + $ "No action found to be executed: " + ++ ".\n Actual actions titles: " ++ show (map (^. L.title) allActions) + ++ ".\n Expected action titles:" ++ show names -- Silence warnings hsImportSpec formatter args = From eec221798e37a6a0ae0c6d026b7e97b7cd1b5600 Mon Sep 17 00:00:00 2001 From: jneira Date: Fri, 5 Jul 2019 00:06:38 +0200 Subject: [PATCH 2/3] Correct punctuation --- test/functional/FunctionalCodeActionsSpec.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/functional/FunctionalCodeActionsSpec.hs b/test/functional/FunctionalCodeActionsSpec.hs index f029cafe1..414a0170a 100644 --- a/test/functional/FunctionalCodeActionsSpec.hs +++ b/test/functional/FunctionalCodeActionsSpec.hs @@ -753,9 +753,9 @@ hsImportSpec formatterName [e1, e2, e3, e4] = (action:_) -> executeCodeAction action [] -> error - $ "No action found to be executed: " - ++ ".\n Actual actions titles: " ++ show (map (^. L.title) allActions) - ++ ".\n Expected action titles:" ++ show names + $ "No action found to be executed!" + ++ "\n Actual actions titles: " ++ show (map (^. L.title) allActions) + ++ "\n Expected action titles: " ++ show names -- Silence warnings hsImportSpec formatter args = From db61869248c16e5f64735b66cd630b659492f9c4 Mon Sep 17 00:00:00 2001 From: jneira Date: Fri, 5 Jul 2019 00:33:22 +0200 Subject: [PATCH 3/3] Correct plural --- test/functional/FunctionalCodeActionsSpec.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional/FunctionalCodeActionsSpec.hs b/test/functional/FunctionalCodeActionsSpec.hs index 414a0170a..76b817243 100644 --- a/test/functional/FunctionalCodeActionsSpec.hs +++ b/test/functional/FunctionalCodeActionsSpec.hs @@ -755,7 +755,7 @@ hsImportSpec formatterName [e1, e2, e3, e4] = error $ "No action found to be executed!" ++ "\n Actual actions titles: " ++ show (map (^. L.title) allActions) - ++ "\n Expected action titles: " ++ show names + ++ "\n Expected actions titles: " ++ show names -- Silence warnings hsImportSpec formatter args =