aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/snippet_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2024-01-03 02:09:18 +0100
committerJustin M. Keyes <justinkz@gmail.com>2024-01-03 02:09:29 +0100
commit04f2f864e270e772c6326cefdf24947f0130e492 (patch)
tree46f83f909b888a66c741032ab955afc6eab84292 /test/functional/lua/snippet_spec.lua
parent59d117ec99b6037cb9fad5bbfb6d0b18f5012927 (diff)
downloadrneovim-04f2f864e270e772c6326cefdf24947f0130e492.tar.gz
rneovim-04f2f864e270e772c6326cefdf24947f0130e492.tar.bz2
rneovim-04f2f864e270e772c6326cefdf24947f0130e492.zip
refactor: format test/*
Diffstat (limited to 'test/functional/lua/snippet_spec.lua')
-rw-r--r--test/functional/lua/snippet_spec.lua19
1 files changed, 14 insertions, 5 deletions
diff --git a/test/functional/lua/snippet_spec.lua b/test/functional/lua/snippet_spec.lua
index f0b3b44139..defd13429e 100644
--- a/test/functional/lua/snippet_spec.lua
+++ b/test/functional/lua/snippet_spec.lua
@@ -154,7 +154,10 @@ describe('vim.snippet', function()
end)
it('errors with multiple placeholders for the same index', function()
- test_expand_fail('class ${1:Foo} { void ${1:foo}() {} }', 'multiple placeholders for tabstop $1')
+ test_expand_fail(
+ 'class ${1:Foo} { void ${1:foo}() {} }',
+ 'multiple placeholders for tabstop $1'
+ )
end)
it('errors with multiple $0 tabstops', function()
@@ -162,26 +165,32 @@ describe('vim.snippet', function()
end)
it('cancels session when deleting the snippet', function()
- test_expand_success({ 'local function $1()', ' $0', 'end' }, { 'local function ()', ' ', 'end' })
+ test_expand_success(
+ { 'local function $1()', ' $0', 'end' },
+ { 'local function ()', ' ', 'end' }
+ )
feed('<esc>Vjjd')
eq(false, exec_lua('return vim.snippet.active()'))
end)
it('cancels session when inserting outside snippet region', function()
feed('i<cr>')
- test_expand_success({ 'local function $1()', ' $0', 'end' }, { '', 'local function ()', ' ', 'end' })
+ test_expand_success(
+ { 'local function $1()', ' $0', 'end' },
+ { '', 'local function ()', ' ', 'end' }
+ )
feed('<esc>O-- A comment')
eq(false, exec_lua('return vim.snippet.active()'))
end)
- it('inserts choice', function ()
+ it('inserts choice', function()
test_expand_success({ 'console.${1|assert,log,error|}()' }, { 'console.()' })
sleep(100)
feed('<Down><C-y>')
eq({ 'console.log()' }, buf_lines(0))
end)
- it('closes the choice completion menu when jumping', function ()
+ it('closes the choice completion menu when jumping', function()
test_expand_success({ 'console.${1|assert,log,error|}($2)' }, { 'console.()' })
sleep(100)
exec_lua('vim.snippet.jump(1)')