Add test for config validation.
This commit is contained in:
parent
670f7d108b
commit
024083c7d2
4
TODO.md
4
TODO.md
@ -102,13 +102,15 @@ done, but these are the sort of enhancements I am thinking about.
|
||||
- [ ] fields
|
||||
- [ ] go to references of fields when tables are aliased
|
||||
- [ ] global search across other files
|
||||
- [ ] Options / Configuration
|
||||
- [X] Options / Configuration
|
||||
- [X] Configure over LSP
|
||||
- [X] Configure with some sort of per-project config file
|
||||
- [X] fennel/lua path
|
||||
- [X] lua version
|
||||
- [X] allowed global list
|
||||
- [X] enable/disable various linters
|
||||
- [X] config validation
|
||||
- [X] tests for config validation
|
||||
- [X] rename
|
||||
- [X] local symbols
|
||||
- [ ] module fields (may affect code behavior, may modify other files)
|
||||
|
||||
@ -87,8 +87,6 @@
|
||||
(or (. specials builtin-name)
|
||||
(. macros* builtin-name)))
|
||||
|
||||
;; TODO get-module-metadata
|
||||
|
||||
(λ validate-config [configuration invalid]
|
||||
(when (not (. lua-versions configuration.lua-version))
|
||||
(invalid (.. "fennel-ls doesn't know about lua version "
|
||||
|
||||
@ -63,7 +63,21 @@
|
||||
(local _ nil))
|
||||
nil)
|
||||
|
||||
(fn test-config-validation []
|
||||
(let [client (create-client {:main.fnl ""
|
||||
:flsproject.fnl "{:lua-version \"lua5.0\"}"})
|
||||
[_init show] client.initialize-response]
|
||||
(faith.= "window/showMessage" show.method)
|
||||
(faith.match "doesn't know about lua version lua5.0" show.params.message))
|
||||
(let [client (create-client {:main.fnl ""
|
||||
:flsproject.fnl "{:libraries {:nasilemak true}}"})
|
||||
[_init show] client.initialize-response]
|
||||
(faith.= "window/showMessage" show.method)
|
||||
(faith.match "Could not find docset for library nasilemak"
|
||||
show.params.message)))
|
||||
|
||||
{: test-path
|
||||
: test-extra-globals
|
||||
: test-lints
|
||||
: test-config-validation
|
||||
: test-editing-settings}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user