add test for hover over modules

This commit is contained in:
XeroOl 2024-03-03 23:03:31 -06:00
parent 24dc75eacc
commit f14d91b9c4
No known key found for this signature in database
GPG Key ID: 9DD4B4B4DAED0322
2 changed files with 7 additions and 1 deletions

View File

@ -188,6 +188,7 @@
;; unnecessary (do) in body position
;; duplicate keys in kv table
;; (tset <sym> <str>) --> (set <sym>.<str>)
;; (tset <sym> <any>) --> (set (. <sym> <any>))
;; {&as x} and [&as x] pattern with no other matches
;; Unused variables / fields (maybe difficult)
;; discarding results to various calls, such as unpack, values, etc

View File

@ -6,9 +6,13 @@
(fn check [file-contents ?response-string]
(let [{: self : uri : cursor} (create-client-with-files file-contents)
[message] (self:hover uri cursor)]
(if ?response-string
(if (= (type ?response-string) :string)
(faith.= ?response-string (?. message :result :contents :value)
(.. "Invalid hover message\nfrom: " (view file-contents)))
(= (type ?response-string) :function)
(faith.is (?response-string (?. message :result :contents :value))
(.. "Invalid hover message\nfrom: " (view file-contents)))
(faith.= null message.result))))
@ -58,6 +62,7 @@ and [`io.write`](https://lua.org/manual/5.4/manual.html#pdf-io.write).")
```
This function is similar to [`pcall`](https://lua.org/manual/5.4/manual.html#pdf-pcall), except that it sets a
new message handler `msgh`.")
(check "(table.inser|t [] :message" #($:find "```fnl\n(insert list ?pos value)\n```" 1 true))
nil)
(fn test-functions []