test: add check for unused diagnostic
This commit is contained in:
parent
b6b51698c4
commit
3da1e6304b
@ -81,6 +81,20 @@
|
|||||||
"not found")
|
"not found")
|
||||||
_ (error "did not match"))))
|
_ (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"
|
(it "warns about vars that are never set"
|
||||||
(let [self (create-client)
|
(let [self (create-client)
|
||||||
responses (self:open-file! filename "(var x nil) (print x)")]
|
responses (self:open-file! filename "(var x nil) (print x)")]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user