Skip to content

Commit

Permalink
test: add LSP config tests
Browse files Browse the repository at this point in the history
  • Loading branch information
S1M0N38 committed Feb 11, 2024
1 parent 436f3ee commit 202efa5
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/love2d/love2d_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,26 @@ describe("love2d platform", function()
assert.equal(0, love2d.job.exit_code)
end)
end)

describe("love2d LSP", function()
it("avoids configuration", function()
opts.path_to_love_library = ""
vim.cmd("e tests/game/main.lua")
vim.wait(1000) -- wait for LSP to load
love2d.setup(opts)
vim.wait(2000) -- wait for love workspce to load
vim.lsp.buf.workspace_symbol("love.math")
vim.wait(1000) -- wait for workspace query to return
assert.True(#vim.fn.getqflist() == 0)
end)
it("configures", function()
opts.path_to_love_library = nil
vim.cmd("e tests/game/main.lua")
vim.wait(1000) -- wait for LSP to load
love2d.setup(opts)
vim.wait(2000) -- wait for love workspce to load
vim.lsp.buf.workspace_symbol("love.math")
vim.wait(1000) -- wait for workspace query to return
assert.True(#vim.fn.getqflist() > 0)
end)
end)

0 comments on commit 202efa5

Please sign in to comment.