aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2025-05-02 10:34:25 +0200
committerGitHub <noreply@github.com>2025-05-02 10:34:25 +0200
commitda401ca25b4dbef121da627fdcdc1dbaf8b7e092 (patch)
tree53a37c82e5e7298a30c4809c452926aa0a31fa5b /test/functional/lua
parentce8b755a86c10496a81675c49b3bc9a42c79d80f (diff)
parent1f004970f00bd8ef7ad955b52857df136f82185b (diff)
downloadrneovim-da401ca25b4dbef121da627fdcdc1dbaf8b7e092.tar.gz
rneovim-da401ca25b4dbef121da627fdcdc1dbaf8b7e092.tar.bz2
rneovim-da401ca25b4dbef121da627fdcdc1dbaf8b7e092.zip
Merge pull request #28344 from bfredl/wonderland
feat(build): build.zig MVP: build and run functionaltests on linux
Diffstat (limited to 'test/functional/lua')
-rw-r--r--test/functional/lua/comment_spec.lua3
-rw-r--r--test/functional/lua/fs_spec.lua21
-rw-r--r--test/functional/lua/vim_spec.lua11
3 files changed, 24 insertions, 11 deletions
diff --git a/test/functional/lua/comment_spec.lua b/test/functional/lua/comment_spec.lua
index 9ae9ce84d0..3284276b32 100644
--- a/test/functional/lua/comment_spec.lua
+++ b/test/functional/lua/comment_spec.lua
@@ -47,7 +47,8 @@ local setup_treesitter = function()
end
before_each(function()
- clear({ args_rm = { '--cmd' }, args = { '--clean' } })
+ -- avoid options, but we still need TS parsers
+ clear({ args_rm = { '--cmd' }, args = { '--clean', '--cmd', n.runtime_set } })
end)
describe('commenting', function()
diff --git a/test/functional/lua/fs_spec.lua b/test/functional/lua/fs_spec.lua
index 33af25f629..dc1a1a0a5b 100644
--- a/test/functional/lua/fs_spec.lua
+++ b/test/functional/lua/fs_spec.lua
@@ -245,8 +245,8 @@ describe('vim.fs', function()
describe('find()', function()
it('works', function()
eq(
- { test_build_dir .. '/build' },
- vim.fs.find('build', { path = nvim_dir, upward = true, type = 'directory' })
+ { test_build_dir .. '/bin' },
+ vim.fs.find('bin', { path = nvim_dir, upward = true, type = 'directory' })
)
eq({ nvim_prog }, vim.fs.find(nvim_prog_basename, { path = test_build_dir, type = 'file' }))
@@ -255,7 +255,7 @@ describe('vim.fs', function()
end)
it('follows symlinks', function()
- local build_dir = test_source_path .. '/build' ---@type string
+ local build_dir = test_build_dir ---@type string
local symlink = test_source_path .. '/build_link' ---@type string
vim.uv.fs_symlink(build_dir, symlink, { junction = true, dir = true })
@@ -263,8 +263,11 @@ describe('vim.fs', function()
vim.uv.fs_unlink(symlink)
end)
+ local cases = { nvim_prog, symlink .. '/bin/' .. nvim_prog_basename }
+ table.sort(cases)
+
eq(
- { nvim_prog, symlink .. '/bin/' .. nvim_prog_basename },
+ cases,
vim.fs.find(nvim_prog_basename, {
path = test_source_path,
type = 'file',
@@ -273,6 +276,9 @@ describe('vim.fs', function()
})
)
+ if t.is_zig_build() then
+ return pending('broken with build.zig')
+ end
eq(
{ nvim_prog },
vim.fs.find(nvim_prog_basename, {
@@ -285,6 +291,9 @@ describe('vim.fs', function()
end)
it('follow=true handles symlink loop', function()
+ if t.is_zig_build() then
+ return pending('broken/slow with build.zig')
+ end
local cwd = test_source_path ---@type string
local symlink = test_source_path .. '/loop_link' ---@type string
vim.uv.fs_symlink(cwd, symlink, { junction = true, dir = true })
@@ -304,9 +313,9 @@ describe('vim.fs', function()
it('accepts predicate as names', function()
local opts = { path = nvim_dir, upward = true, type = 'directory' }
eq(
- { test_build_dir .. '/build' },
+ { test_build_dir .. '/bin' },
vim.fs.find(function(x)
- return x == 'build'
+ return x == 'bin'
end, opts)
)
eq(
diff --git a/test/functional/lua/vim_spec.lua b/test/functional/lua/vim_spec.lua
index dbddd76c99..c499f8bf25 100644
--- a/test/functional/lua/vim_spec.lua
+++ b/test/functional/lua/vim_spec.lua
@@ -2100,9 +2100,9 @@ describe('lua stdlib', function()
eq(false, fn.luaeval "vim.v['false']")
eq(NIL, fn.luaeval 'vim.v.null')
matches([[attempt to index .* nil value]], pcall_err(exec_lua, 'return vim.v[0].progpath'))
- eq('Key is read-only: count', pcall_err(exec_lua, [[vim.v.count = 42]]))
- eq('Dict is locked', pcall_err(exec_lua, [[vim.v.nosuchvar = 42]]))
- eq('Key is fixed: errmsg', pcall_err(exec_lua, [[vim.v.errmsg = nil]]))
+ matches('Key is read%-only: count$', pcall_err(exec_lua, [[vim.v.count = 42]]))
+ matches('Dict is locked$', pcall_err(exec_lua, [[vim.v.nosuchvar = 42]]))
+ matches('Key is fixed: errmsg$', pcall_err(exec_lua, [[vim.v.errmsg = nil]]))
exec_lua([[vim.v.errmsg = 'set by Lua']])
eq('set by Lua', eval('v:errmsg'))
exec_lua([[vim.v.errmsg = 42]])
@@ -2111,7 +2111,10 @@ describe('lua stdlib', function()
eq({ 'one', 'two' }, eval('v:oldfiles'))
exec_lua([[vim.v.oldfiles = {}]])
eq({}, eval('v:oldfiles'))
- eq('Setting v:oldfiles to value with wrong type', pcall_err(exec_lua, [[vim.v.oldfiles = 'a']]))
+ matches(
+ 'Setting v:oldfiles to value with wrong type$',
+ pcall_err(exec_lua, [[vim.v.oldfiles = 'a']])
+ )
eq({}, eval('v:oldfiles'))
feed('i foo foo foo<Esc>0/foo<CR>')