Skip to content

Commit

Permalink
tests: allow modification of setup-table.
Browse files Browse the repository at this point in the history
  • Loading branch information
L3MON4D3 committed Mar 22, 2023
1 parent 1d37207 commit ac4fcdb
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions tests/helpers.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
local helpers = require("test.functional.helpers")(after_each)
local exec_lua = helpers.exec_lua
local exec = helpers.exec
local assert = require("luassert")

local M = {}
Expand Down Expand Up @@ -28,6 +29,8 @@ function M.session_setup_luasnip(opts)
opts = opts or {}
local no_snip_globals = opts.no_snip_globals ~= nil and opts.no_snip_globals
or false
local setup_extend = opts.setup_extend ~= nil and opts.setup_extend
or {}

-- stylua: ignore
helpers.exec("set rtp+=" .. os.getenv("LUASNIP_SOURCE"))
Expand All @@ -39,15 +42,14 @@ function M.session_setup_luasnip(opts)
)

helpers.exec_lua([[
-- MYVIMRC might not be set when nvim is loaded like this.
vim.env.MYVIMRC = "/.vimrc"
-- MYVIMRC might not be set when nvim is loaded like this.
vim.env.MYVIMRC = "/.vimrc"
ls = require("luasnip")
ls.setup({
store_selection_keys = "<Tab>"
})
]])
ls = require("luasnip")
ls.setup(vim.tbl_extend("force", {
store_selection_keys = "<Tab>"
}, ...))
]], setup_extend)

if not no_snip_globals then
helpers.exec_lua([[
Expand Down

0 comments on commit ac4fcdb

Please sign in to comment.