mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 03:15:39 +00:00
test/functional: Fix api/vim_spec.lua.
On Windows the default file format is DOS i.e. newlines are \r\n instead of \n.
This commit is contained in:
committed by
Seth Jackson
parent
04cd3eef24
commit
a48508de0d
@@ -3,7 +3,7 @@ local helpers = require('test.functional.helpers')
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
local clear, nvim, eq, neq = helpers.clear, helpers.nvim, helpers.eq, helpers.neq
|
||||
local ok, nvim_async, feed = helpers.ok, helpers.nvim_async, helpers.feed
|
||||
|
||||
local os_is_windows = helpers.os_is_windows
|
||||
|
||||
describe('vim_* functions', function()
|
||||
before_each(clear)
|
||||
@@ -17,7 +17,11 @@ describe('vim_* functions', function()
|
||||
nvim('command', 'w')
|
||||
local f = io.open(fname)
|
||||
ok(f ~= nil)
|
||||
eq('testing\napi\n', f:read('*a'))
|
||||
if os_is_windows() then
|
||||
eq('testing\r\napi\r\n', f:read('*a'))
|
||||
else
|
||||
eq('testing\napi\n', f:read('*a'))
|
||||
end
|
||||
f:close()
|
||||
os.remove(fname)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user