test function to check code actions don't exist

This commit is contained in:
XeroOl 2024-05-04 01:27:37 -05:00
parent bd2d208724
commit d06e0dfbe8
No known key found for this signature in database
GPG Key ID: 9DD4B4B4DAED0322

View File

@ -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 (+====)]