mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 03:15:39 +00:00
test: correct order of arguments to eq() (#27816)
This commit is contained in:
@@ -312,15 +312,15 @@ describe('lua buffer event callbacks: on_lines', function()
|
||||
feed('G0')
|
||||
feed('p')
|
||||
-- Is the last arg old_byte_size correct? Doesn't matter for this PR
|
||||
eq(api.nvim_get_var('linesev'), { 'lines', 1, 4, 2, 3, 5, 4 })
|
||||
eq({ 'lines', 1, 4, 2, 3, 5, 4 }, api.nvim_get_var('linesev'))
|
||||
|
||||
feed('2G0')
|
||||
feed('p')
|
||||
eq(api.nvim_get_var('linesev'), { 'lines', 1, 5, 1, 4, 4, 8 })
|
||||
eq({ 'lines', 1, 5, 1, 4, 4, 8 }, api.nvim_get_var('linesev'))
|
||||
|
||||
feed('1G0')
|
||||
feed('P')
|
||||
eq(api.nvim_get_var('linesev'), { 'lines', 1, 6, 0, 3, 3, 9 })
|
||||
eq({ 'lines', 1, 6, 0, 3, 3, 9 }, api.nvim_get_var('linesev'))
|
||||
end)
|
||||
|
||||
it(
|
||||
|
||||
@@ -205,7 +205,7 @@ describe('vim.diagnostic', function()
|
||||
diag[1].col = 10000
|
||||
return vim.diagnostic.get()[1].col == 10000
|
||||
]]
|
||||
eq(result, false)
|
||||
eq(false, result)
|
||||
end)
|
||||
|
||||
it('resolves buffer number 0 to the current buffer', function()
|
||||
|
||||
@@ -166,7 +166,7 @@ describe('thread', function()
|
||||
]]
|
||||
|
||||
local msg = next_msg()
|
||||
eq(msg[1], 'notification')
|
||||
eq('notification', msg[1])
|
||||
assert(tonumber(msg[2]) >= 72961)
|
||||
end)
|
||||
|
||||
@@ -327,7 +327,7 @@ describe('threadpool', function()
|
||||
]]
|
||||
|
||||
local msg = next_msg()
|
||||
eq(msg[1], 'notification')
|
||||
eq('notification', msg[1])
|
||||
assert(tonumber(msg[2]) >= 72961)
|
||||
end)
|
||||
|
||||
|
||||
@@ -2016,7 +2016,7 @@ describe('lua stdlib', function()
|
||||
vim.opt.scrolloff = 10
|
||||
return vim.o.scrolloff
|
||||
]]
|
||||
eq(scrolloff, 10)
|
||||
eq(10, scrolloff)
|
||||
end)
|
||||
|
||||
pending('should handle STUPID window things', function()
|
||||
@@ -2037,7 +2037,7 @@ describe('lua stdlib', function()
|
||||
vim.opt.wildignore = { 'hello', 'world' }
|
||||
return vim.o.wildignore
|
||||
]]
|
||||
eq(wildignore, 'hello,world')
|
||||
eq('hello,world', wildignore)
|
||||
end)
|
||||
|
||||
it('should allow setting tables with shortnames', function()
|
||||
@@ -2045,7 +2045,7 @@ describe('lua stdlib', function()
|
||||
vim.opt.wig = { 'hello', 'world' }
|
||||
return vim.o.wildignore
|
||||
]]
|
||||
eq(wildignore, 'hello,world')
|
||||
eq('hello,world', wildignore)
|
||||
end)
|
||||
|
||||
it('should error when you attempt to set string values to numeric options', function()
|
||||
@@ -2451,13 +2451,13 @@ describe('lua stdlib', function()
|
||||
vim.opt.wildignore = 'foo'
|
||||
return vim.o.wildignore
|
||||
]]
|
||||
eq(wildignore, 'foo')
|
||||
eq('foo', wildignore)
|
||||
|
||||
wildignore = exec_lua [[
|
||||
vim.opt.wildignore = vim.opt.wildignore + { 'bar', 'baz' }
|
||||
return vim.o.wildignore
|
||||
]]
|
||||
eq(wildignore, 'foo,bar,baz')
|
||||
eq('foo,bar,baz', wildignore)
|
||||
end)
|
||||
|
||||
it('should handle adding duplicates', function()
|
||||
@@ -2465,19 +2465,19 @@ describe('lua stdlib', function()
|
||||
vim.opt.wildignore = 'foo'
|
||||
return vim.o.wildignore
|
||||
]]
|
||||
eq(wildignore, 'foo')
|
||||
eq('foo', wildignore)
|
||||
|
||||
wildignore = exec_lua [[
|
||||
vim.opt.wildignore = vim.opt.wildignore + { 'bar', 'baz' }
|
||||
return vim.o.wildignore
|
||||
]]
|
||||
eq(wildignore, 'foo,bar,baz')
|
||||
eq('foo,bar,baz', wildignore)
|
||||
|
||||
wildignore = exec_lua [[
|
||||
vim.opt.wildignore = vim.opt.wildignore + { 'bar', 'baz' }
|
||||
return vim.o.wildignore
|
||||
]]
|
||||
eq(wildignore, 'foo,bar,baz')
|
||||
eq('foo,bar,baz', wildignore)
|
||||
end)
|
||||
|
||||
it('should allow adding multiple times', function()
|
||||
@@ -2486,7 +2486,7 @@ describe('lua stdlib', function()
|
||||
vim.opt.wildignore = vim.opt.wildignore + 'bar' + 'baz'
|
||||
return vim.o.wildignore
|
||||
]]
|
||||
eq(wildignore, 'foo,bar,baz')
|
||||
eq('foo,bar,baz', wildignore)
|
||||
end)
|
||||
|
||||
it('should remove values when you use minus', function()
|
||||
@@ -2494,19 +2494,19 @@ describe('lua stdlib', function()
|
||||
vim.opt.wildignore = 'foo'
|
||||
return vim.o.wildignore
|
||||
]]
|
||||
eq(wildignore, 'foo')
|
||||
eq('foo', wildignore)
|
||||
|
||||
wildignore = exec_lua [[
|
||||
vim.opt.wildignore = vim.opt.wildignore + { 'bar', 'baz' }
|
||||
return vim.o.wildignore
|
||||
]]
|
||||
eq(wildignore, 'foo,bar,baz')
|
||||
eq('foo,bar,baz', wildignore)
|
||||
|
||||
wildignore = exec_lua [[
|
||||
vim.opt.wildignore = vim.opt.wildignore - 'bar'
|
||||
return vim.o.wildignore
|
||||
]]
|
||||
eq(wildignore, 'foo,baz')
|
||||
eq('foo,baz', wildignore)
|
||||
end)
|
||||
|
||||
it('should prepend values when using ^', function()
|
||||
@@ -2521,7 +2521,7 @@ describe('lua stdlib', function()
|
||||
vim.opt.wildignore = vim.opt.wildignore ^ 'super_first'
|
||||
return vim.o.wildignore
|
||||
]]
|
||||
eq(wildignore, 'super_first,first,foo')
|
||||
eq('super_first,first,foo', wildignore)
|
||||
end)
|
||||
|
||||
it('should not remove duplicates from wildmode: #14708', function()
|
||||
@@ -2530,7 +2530,7 @@ describe('lua stdlib', function()
|
||||
return vim.o.wildmode
|
||||
]]
|
||||
|
||||
eq(wildmode, 'full,list,full')
|
||||
eq('full,list,full', wildmode)
|
||||
end)
|
||||
|
||||
describe('option types', function()
|
||||
@@ -2738,7 +2738,7 @@ describe('lua stdlib', function()
|
||||
return vim.go.whichwrap
|
||||
]]
|
||||
|
||||
eq(ww, 'b,s')
|
||||
eq('b,s', ww)
|
||||
eq(
|
||||
'b,s,<,>,[,]',
|
||||
exec_lua [[
|
||||
|
||||
Reference in New Issue
Block a user