mirror of
https://github.com/neovim/neovim.git
synced 2025-12-10 08:32:42 +00:00
test: simplify platform detection (#21020)
Extend the capabilities of is_os to detect more platforms such as
freebsd and openbsd. Also remove `iswin()` helper function as it can be
replaced by `is_os("win")`.
This commit is contained in:
@@ -7,10 +7,10 @@ local mkdir_p = helpers.mkdir_p
|
||||
local rmdir = helpers.rmdir
|
||||
local nvim_dir = helpers.nvim_dir
|
||||
local test_build_dir = helpers.test_build_dir
|
||||
local iswin = helpers.iswin
|
||||
local nvim_prog = helpers.nvim_prog
|
||||
local is_os = helpers.is_os
|
||||
|
||||
local nvim_prog_basename = iswin() and 'nvim.exe' or 'nvim'
|
||||
local nvim_prog_basename = is_os('win') and 'nvim.exe' or 'nvim'
|
||||
|
||||
before_each(clear)
|
||||
|
||||
@@ -102,7 +102,7 @@ describe('vim.fs', function()
|
||||
eq('C:/Users/jdoe', exec_lua [[ return vim.fs.normalize('C:\\Users\\jdoe') ]])
|
||||
end)
|
||||
it('works with ~', function()
|
||||
if iswin() then
|
||||
if is_os('win') then
|
||||
pending([[$HOME does not exist on Windows ¯\_(ツ)_/¯]])
|
||||
end
|
||||
eq(os.getenv('HOME') .. '/src/foo', exec_lua [[ return vim.fs.normalize('~/src/foo') ]])
|
||||
|
||||
Reference in New Issue
Block a user