aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/editor/mode_normal_spec.lua22
-rw-r--r--test/functional/lua/luaeval_spec.lua2
-rw-r--r--test/old/testdir/test_goto.vim13
3 files changed, 33 insertions, 4 deletions
diff --git a/test/functional/editor/mode_normal_spec.lua b/test/functional/editor/mode_normal_spec.lua
new file mode 100644
index 0000000000..89bab3f6c9
--- /dev/null
+++ b/test/functional/editor/mode_normal_spec.lua
@@ -0,0 +1,22 @@
+-- Normal mode tests.
+
+local helpers = require('test.functional.helpers')(after_each)
+local clear = helpers.clear
+local feed = helpers.feed
+local fn = helpers.fn
+local command = helpers.command
+local eq = helpers.eq
+
+describe('Normal mode', function()
+ before_each(clear)
+
+ it('setting &winhighlight or &winblend does not change curswant #27470', function()
+ fn.setline(1, { 'long long lone line', 'short line' })
+ feed('ggfi')
+ local pos = fn.getcurpos()
+ feed('j')
+ command('setlocal winblend=10 winhighlight=Visual:Search')
+ feed('k')
+ eq(pos, fn.getcurpos())
+ end)
+end)
diff --git a/test/functional/lua/luaeval_spec.lua b/test/functional/lua/luaeval_spec.lua
index 171d37ba55..b28cfa4dd2 100644
--- a/test/functional/lua/luaeval_spec.lua
+++ b/test/functional/lua/luaeval_spec.lua
@@ -538,6 +538,8 @@ describe('v:lua', function()
eq('\tbadval', eval("v:lua.require'leftpad'('badval')"))
eq(9003, eval("v:lua.require'bar'.doit()"))
eq(9004, eval("v:lua.require'baz-quux'.doit()"))
+ eq(9003, eval("1 ? v:lua.require'bar'.doit() : v:lua.require'baz-quux'.doit()"))
+ eq(9004, eval("0 ? v:lua.require'bar'.doit() : v:lua.require'baz-quux'.doit()"))
end)
it('throw errors for invalid use', function()
diff --git a/test/old/testdir/test_goto.vim b/test/old/testdir/test_goto.vim
index 6d029ffda2..c5492ff97b 100644
--- a/test/old/testdir/test_goto.vim
+++ b/test/old/testdir/test_goto.vim
@@ -313,18 +313,23 @@ func Test_gd_string_only()
call XTest_goto_decl('gd', lines, 5, 10)
endfunc
-" Check that setting 'cursorline' does not change curswant
-func Test_cursorline_keep_col()
+" Check that setting some options does not change curswant
+func Test_set_options_keep_col()
new
call setline(1, ['long long long line', 'short line'])
normal ggfi
let pos = getcurpos()
normal j
- set cursorline
+ set invhlsearch spell spelllang=en,cjk spelloptions=camel textwidth=80
+ set cursorline cursorcolumn cursorlineopt=line colorcolumn=+1
+ set background=dark
+ set background=light
normal k
call assert_equal(pos, getcurpos())
bwipe!
- set nocursorline
+ set hlsearch& spell& spelllang& spelloptions& textwidth&
+ set cursorline& cursorcolumn& cursorlineopt& colorcolumn&
+ set background&
endfunc
func Test_gd_local_block()