From d06e0dfbe8d9800bc8ab6d1e67bfcf110b66bfe5 Mon Sep 17 00:00:00 2001 From: XeroOl Date: Sat, 4 May 2024 01:27:37 -0500 Subject: [PATCH] test function to check code actions don't exist --- test/code-action.fnl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/code-action.fnl b/test/code-action.fnl index 22776dd..cd5c3cf 100644 --- a/test/code-action.fnl +++ b/test/code-action.fnl @@ -14,13 +14,20 @@ action))] (if (not action) (error - (.. "I couldn't find your action \"" action-I-want-to-take "\" in: -" + (.. "I couldn't find your action \"" action-I-want-to-take "\" in:\n" (view (icollect [_ action (ipairs responses)] action.title))))) (let [edits (?. action :edit :changes uri) edited-text (apply-edits text edits encoding)] (faith.= desired-file-contents edited-text)))) +(fn check-negative [file-contents action-not-suggested] + (let [{: self : uri :locations [range]} (create-client-with-files file-contents) + [{:result responses}] (self:code-action uri range.range)] + (each [_ action (ipairs responses)] + (assert (not= action.title action-not-suggested) + (.. "I found your action \"" action-not-suggested "\" in:\n" + (view (icollect [_ action (ipairs responses)] + action.title))))))) (fn test-fix-op-no-arguments [] (check "(let [x (+====)]