diff options
Diffstat (limited to 'test/functional/legacy')
-rw-r--r-- | test/functional/legacy/cmdline_spec.lua | 70 | ||||
-rw-r--r-- | test/functional/legacy/highlight_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/legacy/messages_spec.lua | 41 | ||||
-rw-r--r-- | test/functional/legacy/signs_spec.lua | 9 | ||||
-rw-r--r-- | test/functional/legacy/substitute_spec.lua | 6 | ||||
-rw-r--r-- | test/functional/legacy/window_cmd_spec.lua | 4 |
6 files changed, 123 insertions, 9 deletions
diff --git a/test/functional/legacy/cmdline_spec.lua b/test/functional/legacy/cmdline_spec.lua index bf146e1322..819b40323a 100644 --- a/test/functional/legacy/cmdline_spec.lua +++ b/test/functional/legacy/cmdline_spec.lua @@ -159,6 +159,50 @@ describe('cmdline', function() endfunc ]]) + feed(':resize -3<CR>') + screen:expect([[ + ^ | + {1:~ }|*2 + {3:[No Name] }| + |*4 + ]]) + + -- :resize now also changes 'cmdheight' accordingly + feed(':set cmdheight+=1<CR>') + screen:expect([[ + ^ | + {1:~ }| + {3:[No Name] }| + |*5 + ]]) + + -- using more space moves the status line up + feed(':set cmdheight+=1<CR>') + screen:expect([[ + ^ | + {3:[No Name] }| + |*6 + ]]) + + -- reducing cmdheight moves status line down + feed(':set cmdheight-=3<CR>') + screen:expect([[ + ^ | + {1:~ }|*3 + {3:[No Name] }| + |*3 + ]]) + + -- reducing window size and then setting cmdheight + feed(':resize -1<CR>') + feed(':set cmdheight=1<CR>') + screen:expect([[ + ^ | + {1:~ }|*5 + {3:[No Name] }| + | + ]]) + -- setting 'cmdheight' works after outputting two messages feed(':call EchoTwo()') screen:expect([[ @@ -185,6 +229,16 @@ describe('cmdline', function() bar | {6:Press ENTER or type command to continue}^ | ]]) + + -- window commands do not reduce 'cmdheight' to value lower than :set by user + feed('<CR>:wincmd _<CR>') + screen:expect([[ + ^ | + {1:~ }|*4 + {3:[No Name] }| + :wincmd _ | + | + ]]) end) -- oldtest: Test_cmdheight_tabline() @@ -216,6 +270,22 @@ describe('cmdline', function() longish | ]] end) + + -- oldtest: Test_rulerformat_function() + it("'rulerformat' can use %!", function() + local screen = Screen.new(40, 2) + exec([[ + func TestRulerFn() + return '10,20%=30%%' + endfunc + ]]) + api.nvim_set_option_value('ruler', true, {}) + api.nvim_set_option_value('rulerformat', '%!TestRulerFn()', {}) + screen:expect([[ + ^ | + 10,20 30% | + ]]) + end) end) describe('cmdwin', function() diff --git a/test/functional/legacy/highlight_spec.lua b/test/functional/legacy/highlight_spec.lua index e663931bd7..24d6abcc6b 100644 --- a/test/functional/legacy/highlight_spec.lua +++ b/test/functional/legacy/highlight_spec.lua @@ -29,8 +29,8 @@ describe(':highlight', function() | TermCursor {2:xxx} {18:cterm=}reverse | {18:gui=}reverse | - TermCursorNC xxx cleared | NonText {1:xxx} {18:ctermfg=}12 | + {18:gui=}bold | {6:-- More --}^ | ]]) feed('q') diff --git a/test/functional/legacy/messages_spec.lua b/test/functional/legacy/messages_spec.lua index bc58551a34..db5e3f6857 100644 --- a/test/functional/legacy/messages_spec.lua +++ b/test/functional/legacy/messages_spec.lua @@ -82,7 +82,7 @@ describe('messages', function() NoSuchFil^e | three | {1:~ }|*5 - from DebugSilent visual | + | {9:E447: Can't find file "NoSuchFile" in path} | ]]) end) @@ -689,4 +689,43 @@ describe('messages', function() ]]) os.remove('b.txt') end) + + -- oldtest: Test_messagesopt_wait() + it('&messagesopt "wait"', function() + screen = Screen.new(45, 6) + command('set cmdheight=1') + + -- Check hit-enter prompt + command('set messagesopt=hit-enter,history:500') + feed(":echo 'foo' | echo 'bar' | echo 'baz'\n") + screen:expect([[ + | + {3: }| + foo | + bar | + baz | + {6:Press ENTER or type command to continue}^ | + ]]) + feed('<CR>') + + -- Check no hit-enter prompt when "wait:" is set + command('set messagesopt=wait:500,history:500') + feed(":echo 'foo' | echo 'bar' | echo 'baz'\n") + screen:expect({ + grid = [[ + | + {1:~ }| + {3: }| + foo | + bar | + baz | + ]], + timeout = 500, + }) + screen:expect([[ + ^ | + {1:~ }|*4 + | + ]]) + end) end) diff --git a/test/functional/legacy/signs_spec.lua b/test/functional/legacy/signs_spec.lua index ac7c8cd0bc..af355f27e6 100644 --- a/test/functional/legacy/signs_spec.lua +++ b/test/functional/legacy/signs_spec.lua @@ -26,6 +26,9 @@ describe('signs', function() -- oldtest: Test_sign_cursor_position() it('are drawn correctly', function() local screen = Screen.new(75, 6) + screen:add_extra_attr_ids({ + [100] = { foreground = Screen.colors.Blue4, background = Screen.colors.Yellow }, + }) exec([[ call setline(1, [repeat('x', 75), 'mmmm', 'yyyy']) call cursor(2,1) @@ -37,7 +40,7 @@ describe('signs', function() screen:expect([[ {7: }xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx| {7: }xx | - {10:=>}^mmmm | + {100:=>}^mmmm | {7: }yyyy | {1:~ }| | @@ -48,7 +51,7 @@ describe('signs', function() screen:expect([[ {7: }xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx| {7: }xx | - {10:-)}^mmmm | + {100:-)}^mmmm | {7: }yyyy | {1:~ }| | @@ -59,7 +62,7 @@ describe('signs', function() screen:expect([[ {7: }xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx| {7: }xx | - {10:-)}{4:^mmmm }| + {100:-)}{4:^mmmm }| {7: }yyyy | {1:~ }| | diff --git a/test/functional/legacy/substitute_spec.lua b/test/functional/legacy/substitute_spec.lua index 0081371f7f..30ff13140f 100644 --- a/test/functional/legacy/substitute_spec.lua +++ b/test/functional/legacy/substitute_spec.lua @@ -220,8 +220,10 @@ describe(':substitute', function() {2:o}ne | two | three | - {1:~ }|*4 - {6:replace with (y/n/a/q/l/^E/^Y)?}^ | + {1:~ }|*2 + {3: }| + {6:replace with ? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^}| + {6:E)/down(^Y)}^ | ]]) end) end) diff --git a/test/functional/legacy/window_cmd_spec.lua b/test/functional/legacy/window_cmd_spec.lua index d68c780f49..fac982354c 100644 --- a/test/functional/legacy/window_cmd_spec.lua +++ b/test/functional/legacy/window_cmd_spec.lua @@ -120,7 +120,7 @@ describe('splitkeep', function() row = 0, col = 0, })) - vim.cmd("call termopen([&sh, &shcf, 'true'], { 'on_exit': 'C2' })") + vim.cmd("call jobstart([&sh, &shcf, 'true'], { 'term': v:true, 'on_exit': 'C2' })") end })]]) feed('j') @@ -299,7 +299,7 @@ describe('splitkeep', function() c | {1:~ }| {3:[No Name] }| - | + :call win_move_statusline(win, 1) | ]]) end) |