aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-10-31 03:50:19 +0100
committerJustin M. Keyes <justinkz@gmail.com>2016-11-08 21:20:08 +0100
commitc04ffe866d276d6a6bd9e9c6a8b0dbb71504db7c (patch)
tree0fca258fbfb83cb871a493916d9dd6e0ef1195c3 /test/functional
parente8c0f909626094350be7ee7b524697804da38dc1 (diff)
downloadrneovim-c04ffe866d276d6a6bd9e9c6a8b0dbb71504db7c.tar.gz
rneovim-c04ffe866d276d6a6bd9e9c6a8b0dbb71504db7c.tar.bz2
rneovim-c04ffe866d276d6a6bd9e9c6a8b0dbb71504db7c.zip
'inccommand': rework
- Eliminate/isolate static/global variables - Remove special-case parameter from buflist_new() - Remove special-case ECMD_RESERVED_BUFNR - To determine when u_undo_and_forget() should be done, check b_changedtick instead of a heuristic. - use mb_string2cells() instead of strlen() to measure the :sub patterns - call ml_close() before buf_clear_file(). Avoids leaks caught by ASan. Original patch by: Robin Elrharbi-Fleury (Robinhola) Audrey Rayé (Adrey06) Philémon Hullot (DesbyP) Aymeric Collange (aym7) Clément Guyomard (Clement0)
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/ui/incsubstitute_spec.lua (renamed from test/functional/ui/incsubstitution_spec.lua)54
1 files changed, 22 insertions, 32 deletions
diff --git a/test/functional/ui/incsubstitution_spec.lua b/test/functional/ui/incsubstitute_spec.lua
index 51fc8718ac..21c400c481 100644
--- a/test/functional/ui/incsubstitution_spec.lua
+++ b/test/functional/ui/incsubstitute_spec.lua
@@ -42,19 +42,14 @@ local function common_setup(screen, incsub, text)
})
end
- -- default for incsub is off
- if not incsub then
- incsub = ""
- end
-
- execute("set incsubstitute=" .. incsub)
+ execute("set incsubstitute=" .. (incsub and incsub or ""))
if text then
insert(text)
end
end
-describe('IncSubstitution preserves', function()
+describe("'incsubstitute' preserves", function()
if helpers.pending_win32(pending) then return end
before_each(clear)
@@ -98,7 +93,7 @@ describe('IncSubstitution preserves', function()
end
end)
- it('the undolevels setting', function()
+ it("'undolevels' setting", function()
for _, case in pairs{"", "split", "nosplit"} do
clear()
execute("set undolevels=139")
@@ -113,7 +108,7 @@ describe('IncSubstitution preserves', function()
end)
-describe('IncSubstitution preserves undo functionality', function()
+describe("'incsubstitute' preserves undo", function()
if helpers.pending_win32(pending) then return end
local cases = { "", "split", "nosplit" }
@@ -241,21 +236,16 @@ describe('IncSubstitution preserves undo functionality', function()
2]])
end
- it("at a non-leaf of the undo tree", function()
- -- this does not work even in standard vim
- -- if fixed, easily combined with the test below
- if true then
- pending("vim")
- return
- end
-
--- for _, case in pairs(cases) do
--- for _, str in pairs(substrings) do
--- for _, redoable in pairs({true}) do
--- test_sub(str, case, redoable)
--- end
--- end
--- end
+ -- TODO(vim): This does not work, even in Vim.
+ -- Waiting for fix (perhaps from upstream).
+ pending("at a non-leaf of the undo tree", function()
+ for _, case in pairs(cases) do
+ for _, str in pairs(substrings) do
+ for _, redoable in pairs({true}) do
+ test_sub(str, case, redoable)
+ end
+ end
+ end
end)
it("at a leaf of the undo tree", function()
@@ -555,7 +545,7 @@ describe('IncSubstitution preserves undo functionality', function()
end)
-describe('IncSubstitution with incsubstitute=split', function()
+describe("incsubstitute=split", function()
if helpers.pending_win32(pending) then return end
local screen = Screen.new(30,15)
@@ -693,7 +683,7 @@ describe('IncSubstitution with incsubstitute=split', function()
]])
end)
- it('highlights the patterg up with :set hlsearch', function()
+ it('highlights the pattern with :set hlsearch', function()
execute("set hlsearch")
feed(":%s/tw")
screen:expect([[
@@ -815,7 +805,7 @@ describe('IncSubstitution with incsubstitute=split', function()
end)
-describe('Incsubstitution with incsubstitute=nosplit', function()
+describe("incsubstitute=nosplit", function()
if helpers.pending_win32(pending) then return end
local screen = Screen.new(20,10)
@@ -891,7 +881,7 @@ describe('Incsubstitution with incsubstitute=nosplit', function()
end)
-describe('Incsubstitution with a failing expression', function()
+describe("'incsubstitute' with a failing expression", function()
if helpers.pending_win32(pending) then return end
local screen = Screen.new(20,10)
@@ -927,7 +917,7 @@ describe('Incsubstitution with a failing expression', function()
end)
-describe('Incsubstitution and cnoremap', function()
+describe("'incsubstitute' and :cnoremap", function()
local cases = { "", "split", "nosplit" }
local function refresh(case)
@@ -1041,7 +1031,7 @@ describe('Incsubstitution and cnoremap', function()
end)
-describe('Incsubstitute: autocommands', function()
+describe("'incsubstitute': autocommands", function()
before_each(clear)
-- keys are events to be tested
@@ -1129,7 +1119,7 @@ describe('Incsubstitute: autocommands', function()
end)
-describe('Incsubstitute splits', function()
+describe("'incsubstitute': split windows", function()
if helpers.pending_win32(pending) then return end
local screen
@@ -1143,7 +1133,7 @@ describe('Incsubstitute splits', function()
screen:detach()
end)
- it('work after other splittings', function()
+ it('work after more splits', function()
refresh()
execute("vsplit")