mirror of
https://github.com/neovim/neovim.git
synced 2025-10-10 03:46:31 +00:00
win: enable more functional tests
- plugin/shada_spec.lua: Use \r\n as Windows EOL for tests on BufWriteCmd, FileWriteCmd, FileAppendCmd. Alternative is 'set fileformat=unix'.
This commit is contained in:

committed by
Justin M. Keyes

parent
e9b5616eaf
commit
7311fb7cad
@@ -3,8 +3,6 @@ local clear = helpers.clear
|
|||||||
local eq = helpers.eq
|
local eq = helpers.eq
|
||||||
local getcwd = helpers.funcs.getcwd
|
local getcwd = helpers.funcs.getcwd
|
||||||
|
|
||||||
if helpers.pending_win32(pending) then return end
|
|
||||||
|
|
||||||
describe("'autochdir'", function()
|
describe("'autochdir'", function()
|
||||||
it('given on the shell gets processed properly', function()
|
it('given on the shell gets processed properly', function()
|
||||||
local targetdir = 'test/functional/fixtures'
|
local targetdir = 'test/functional/fixtures'
|
||||||
@@ -12,9 +10,10 @@ describe("'autochdir'", function()
|
|||||||
-- By default 'autochdir' is off, thus getcwd() returns the repo root.
|
-- By default 'autochdir' is off, thus getcwd() returns the repo root.
|
||||||
clear(targetdir..'/tty-test.c')
|
clear(targetdir..'/tty-test.c')
|
||||||
local rootdir = getcwd()
|
local rootdir = getcwd()
|
||||||
|
local expected = rootdir .. '/' .. targetdir
|
||||||
|
|
||||||
-- With 'autochdir' on, we should get the directory of tty-test.c.
|
-- With 'autochdir' on, we should get the directory of tty-test.c.
|
||||||
clear('--cmd', 'set autochdir', targetdir..'/tty-test.c')
|
clear('--cmd', 'set autochdir', targetdir..'/tty-test.c')
|
||||||
eq(rootdir..'/'..targetdir, getcwd())
|
eq(helpers.iswin() and expected:gsub('/', '\\') or expected, getcwd())
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
@@ -22,8 +22,6 @@ end
|
|||||||
|
|
||||||
describe('startup defaults', function()
|
describe('startup defaults', function()
|
||||||
describe(':filetype', function()
|
describe(':filetype', function()
|
||||||
if helpers.pending_win32(pending) then return end
|
|
||||||
|
|
||||||
local function expect_filetype(expected)
|
local function expect_filetype(expected)
|
||||||
local screen = Screen.new(50, 4)
|
local screen = Screen.new(50, 4)
|
||||||
screen:attach()
|
screen:attach()
|
||||||
|
@@ -43,8 +43,6 @@ local wshada, _, fname = get_shada_rw('Xtest-functional-plugin-shada.shada')
|
|||||||
local wshada_tmp, _, fname_tmp =
|
local wshada_tmp, _, fname_tmp =
|
||||||
get_shada_rw('Xtest-functional-plugin-shada.shada.tmp.f')
|
get_shada_rw('Xtest-functional-plugin-shada.shada.tmp.f')
|
||||||
|
|
||||||
if helpers.pending_win32(pending) then return end
|
|
||||||
|
|
||||||
describe('In autoload/shada.vim', function()
|
describe('In autoload/shada.vim', function()
|
||||||
local epoch = os.date('%Y-%m-%dT%H:%M:%S', 0)
|
local epoch = os.date('%Y-%m-%dT%H:%M:%S', 0)
|
||||||
before_each(function()
|
before_each(function()
|
||||||
@@ -2140,6 +2138,7 @@ end)
|
|||||||
|
|
||||||
describe('In plugin/shada.vim', function()
|
describe('In plugin/shada.vim', function()
|
||||||
local epoch = os.date('%Y-%m-%dT%H:%M:%S', 0)
|
local epoch = os.date('%Y-%m-%dT%H:%M:%S', 0)
|
||||||
|
local eol = helpers.iswin() and '\r\n' or '\n'
|
||||||
before_each(function()
|
before_each(function()
|
||||||
reset()
|
reset()
|
||||||
os.remove(fname)
|
os.remove(fname)
|
||||||
@@ -2279,7 +2278,7 @@ describe('In plugin/shada.vim', function()
|
|||||||
' + f file name ["foo"]',
|
' + f file name ["foo"]',
|
||||||
' + l line number 2',
|
' + l line number 2',
|
||||||
' + c column -200',
|
' + c column -200',
|
||||||
}, '\n') .. '\n', io.open(fname .. '.tst'):read('*a'))
|
}, eol) .. eol, io.open(fname .. '.tst'):read('*a'))
|
||||||
shada_eq({{
|
shada_eq({{
|
||||||
timestamp=0,
|
timestamp=0,
|
||||||
type=8,
|
type=8,
|
||||||
@@ -2303,6 +2302,7 @@ describe('In plugin/shada.vim', function()
|
|||||||
|
|
||||||
describe('event FileWriteCmd', function()
|
describe('event FileWriteCmd', function()
|
||||||
it('works', function()
|
it('works', function()
|
||||||
|
if helpers.pending_win32(pending) then return end
|
||||||
nvim('set_var', 'shada#add_own_header', 0)
|
nvim('set_var', 'shada#add_own_header', 0)
|
||||||
curbuf('set_lines', 0, 1, true, {
|
curbuf('set_lines', 0, 1, true, {
|
||||||
'Jump with timestamp ' .. epoch .. ':',
|
'Jump with timestamp ' .. epoch .. ':',
|
||||||
@@ -2326,7 +2326,7 @@ describe('In plugin/shada.vim', function()
|
|||||||
'Jump with timestamp ' .. epoch .. ':',
|
'Jump with timestamp ' .. epoch .. ':',
|
||||||
' % Key________ Description Value',
|
' % Key________ Description Value',
|
||||||
' + n name \'A\'',
|
' + n name \'A\'',
|
||||||
}, '\n') .. '\n', io.open(fname .. '.tst'):read('*a'))
|
}, eol) .. eol, io.open(fname .. '.tst'):read('*a'))
|
||||||
shada_eq({{
|
shada_eq({{
|
||||||
timestamp=0,
|
timestamp=0,
|
||||||
type=8,
|
type=8,
|
||||||
@@ -2383,7 +2383,7 @@ describe('In plugin/shada.vim', function()
|
|||||||
' + f file name ["foo"]',
|
' + f file name ["foo"]',
|
||||||
' + l line number 2',
|
' + l line number 2',
|
||||||
' + c column -200',
|
' + c column -200',
|
||||||
}, '\n') .. '\n', io.open(fname .. '.tst'):read('*a'))
|
}, eol) .. eol, io.open(fname .. '.tst'):read('*a'))
|
||||||
shada_eq({{
|
shada_eq({{
|
||||||
timestamp=0,
|
timestamp=0,
|
||||||
type=8,
|
type=8,
|
||||||
|
@@ -4,8 +4,6 @@ local Screen = require('test.functional.ui.screen')
|
|||||||
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
|
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
|
||||||
local command, request, neq = helpers.command, helpers.request, helpers.neq
|
local command, request, neq = helpers.command, helpers.request, helpers.neq
|
||||||
|
|
||||||
if helpers.pending_win32(pending) then return end
|
|
||||||
|
|
||||||
describe('Buffer highlighting', function()
|
describe('Buffer highlighting', function()
|
||||||
local screen
|
local screen
|
||||||
local curbuf
|
local curbuf
|
||||||
|
@@ -121,8 +121,6 @@ describe(":substitute, inccommand=split does not trigger preview", function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
describe(":substitute, 'inccommand' preserves", function()
|
describe(":substitute, 'inccommand' preserves", function()
|
||||||
if helpers.pending_win32(pending) then return end
|
|
||||||
|
|
||||||
before_each(clear)
|
before_each(clear)
|
||||||
|
|
||||||
it('listed buffers (:ls)', function()
|
it('listed buffers (:ls)', function()
|
||||||
@@ -285,8 +283,6 @@ describe(":substitute, 'inccommand' preserves", function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
describe(":substitute, 'inccommand' preserves undo", function()
|
describe(":substitute, 'inccommand' preserves undo", function()
|
||||||
if helpers.pending_win32(pending) then return end
|
|
||||||
|
|
||||||
local cases = { "", "split", "nosplit" }
|
local cases = { "", "split", "nosplit" }
|
||||||
|
|
||||||
local substrings = {
|
local substrings = {
|
||||||
@@ -700,8 +696,6 @@ describe(":substitute, 'inccommand' preserves undo", function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
describe(":substitute, inccommand=split", function()
|
describe(":substitute, inccommand=split", function()
|
||||||
if helpers.pending_win32(pending) then return end
|
|
||||||
|
|
||||||
local screen = Screen.new(30,15)
|
local screen = Screen.new(30,15)
|
||||||
|
|
||||||
before_each(function()
|
before_each(function()
|
||||||
@@ -1169,8 +1163,6 @@ describe(":substitute, inccommand=split", function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
describe("inccommand=nosplit", function()
|
describe("inccommand=nosplit", function()
|
||||||
if helpers.pending_win32(pending) then return end
|
|
||||||
|
|
||||||
local screen = Screen.new(20,10)
|
local screen = Screen.new(20,10)
|
||||||
|
|
||||||
before_each(function()
|
before_each(function()
|
||||||
@@ -1356,8 +1348,6 @@ describe("inccommand=nosplit", function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
describe(":substitute, 'inccommand' with a failing expression", function()
|
describe(":substitute, 'inccommand' with a failing expression", function()
|
||||||
if helpers.pending_win32(pending) then return end
|
|
||||||
|
|
||||||
local screen = Screen.new(20,10)
|
local screen = Screen.new(20,10)
|
||||||
local cases = { "", "split", "nosplit" }
|
local cases = { "", "split", "nosplit" }
|
||||||
|
|
||||||
@@ -1621,8 +1611,6 @@ describe("'inccommand' autocommands", function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
describe("'inccommand' split windows", function()
|
describe("'inccommand' split windows", function()
|
||||||
if helpers.pending_win32(pending) then return end
|
|
||||||
|
|
||||||
local screen
|
local screen
|
||||||
local function refresh()
|
local function refresh()
|
||||||
clear()
|
clear()
|
||||||
|
@@ -4,8 +4,6 @@ local feed, next_message, eq = helpers.feed, helpers.next_message, helpers.eq
|
|||||||
local expect = helpers.expect
|
local expect = helpers.expect
|
||||||
local Screen = require('test.functional.ui.screen')
|
local Screen = require('test.functional.ui.screen')
|
||||||
|
|
||||||
if helpers.pending_win32(pending) then return end
|
|
||||||
|
|
||||||
describe('mappings', function()
|
describe('mappings', function()
|
||||||
local cid
|
local cid
|
||||||
|
|
||||||
|
@@ -4,8 +4,6 @@ local clear, feed, meths = helpers.clear, helpers.feed, helpers.meths
|
|||||||
local insert, feed_command = helpers.insert, helpers.feed_command
|
local insert, feed_command = helpers.insert, helpers.feed_command
|
||||||
local eq, funcs = helpers.eq, helpers.funcs
|
local eq, funcs = helpers.eq, helpers.funcs
|
||||||
|
|
||||||
if helpers.pending_win32(pending) then return end
|
|
||||||
|
|
||||||
describe('ui/mouse/input', function()
|
describe('ui/mouse/input', function()
|
||||||
local screen
|
local screen
|
||||||
|
|
||||||
|
@@ -3,8 +3,6 @@ local Screen = require('test.functional.ui.screen')
|
|||||||
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
|
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
|
||||||
local feed_command = helpers.feed_command
|
local feed_command = helpers.feed_command
|
||||||
|
|
||||||
if helpers.pending_win32(pending) then return end
|
|
||||||
|
|
||||||
describe('search highlighting', function()
|
describe('search highlighting', function()
|
||||||
local screen
|
local screen
|
||||||
local colors = Screen.colors
|
local colors = Screen.colors
|
||||||
|
@@ -2,8 +2,6 @@ local helpers = require('test.functional.helpers')(after_each)
|
|||||||
local Screen = require('test.functional.ui.screen')
|
local Screen = require('test.functional.ui.screen')
|
||||||
local clear, feed, command = helpers.clear, helpers.feed, helpers.command
|
local clear, feed, command = helpers.clear, helpers.feed, helpers.command
|
||||||
|
|
||||||
if helpers.pending_win32(pending) then return end
|
|
||||||
|
|
||||||
describe('Signs', function()
|
describe('Signs', function()
|
||||||
local screen
|
local screen
|
||||||
|
|
||||||
|
@@ -3,8 +3,6 @@ local Screen = require('test.functional.ui.screen')
|
|||||||
local clear, feed, command = helpers.clear, helpers.feed, helpers.command
|
local clear, feed, command = helpers.clear, helpers.feed, helpers.command
|
||||||
local insert = helpers.insert
|
local insert = helpers.insert
|
||||||
|
|
||||||
if helpers.pending_win32(pending) then return end
|
|
||||||
|
|
||||||
describe('Screen', function()
|
describe('Screen', function()
|
||||||
local screen
|
local screen
|
||||||
|
|
||||||
|
@@ -5,8 +5,6 @@ local eval, eq, neq = helpers.eval, helpers.eq, helpers.neq
|
|||||||
local feed_command, source, expect = helpers.feed_command, helpers.source, helpers.expect
|
local feed_command, source, expect = helpers.feed_command, helpers.source, helpers.expect
|
||||||
local meths = helpers.meths
|
local meths = helpers.meths
|
||||||
|
|
||||||
if helpers.pending_win32(pending) then return end
|
|
||||||
|
|
||||||
describe('completion', function()
|
describe('completion', function()
|
||||||
local screen
|
local screen
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user