test: add check for unused diagnostic

This commit is contained in:
XeroOl 2024-02-08 12:26:22 -06:00
parent b6b51698c4
commit 3da1e6304b

View File

@ -81,6 +81,20 @@
"not found")
_ (error "did not match"))))
(it "warns about unused variables from multival destructuring"
(let [self (create-client)
responses (self:open-file! filename "(let [(x y) (values 1 2)] x)")]
(match responses
[{:params {: diagnostics}}]
(is (find [_ v (ipairs diagnostics)]
(match v
{:code 301
:range {:start {:character 9 :line 0}
:end {:character 10 :line 0}}}
v))
"not found")
_ (error "did not match"))))
(it "warns about vars that are never set"
(let [self (create-client)
responses (self:open-file! filename "(var x nil) (print x)")]