Skip to content

Commit

Permalink
test: add test for toolchain path setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm committed Apr 14, 2024
1 parent e8cbd4d commit a015b5c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/server/protocol/Client.v
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ pub fn (mut c Client) progress(params lsp.ProgressParams) {

// log_message sends a window/logMessage notification to the client
pub fn (mut c Client) log_message(message string, typ lsp.MessageType) {
$if test {
if c == unsafe { nil } {
return
}
}
c.wr.write_notify('window/logMessage', lsp.LogMessageParams{
@type: typ
message: message
Expand Down
12 changes: 12 additions & 0 deletions src/server/setup_test.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module server

import os

fn test_setup_vpaths() {
mut ls := LanguageServer{}
ls.setup()
assert ls.paths.vexe == @VEXE
assert ls.paths.vroot == os.dir(ls.paths.vexe)
assert ls.paths.vmodules_root == os.vmodules_dir()
assert ls.paths.vlib_root == os.join_path(ls.paths.vroot, 'vlib')
}

0 comments on commit a015b5c

Please sign in to comment.