diff options
| author | bfredl <bjorn.linse@gmail.com> | 2024-08-14 13:42:05 +0200 |
|---|---|---|
| committer | bfredl <bjorn.linse@gmail.com> | 2024-08-14 14:03:34 +0200 |
| commit | ef4c9b136e0a41ca4a4740688fa0956c2ccbfb2e (patch) | |
| tree | 89c633452a5724d1ac21f81829ba2852c3eade30 /test/functional/autocmd | |
| parent | 9d74dc3ac5a66d0fd34de125476a92ec0a77ca58 (diff) | |
| download | rneovim-ef4c9b136e0a41ca4a4740688fa0956c2ccbfb2e.tar.gz rneovim-ef4c9b136e0a41ca4a4740688fa0956c2ccbfb2e.tar.bz2 rneovim-ef4c9b136e0a41ca4a4740688fa0956c2ccbfb2e.zip | |
refactor(tests): again yet more global highlight definitions
Diffstat (limited to 'test/functional/autocmd')
| -rw-r--r-- | test/functional/autocmd/autocmd_oldtest_spec.lua | 10 | ||||
| -rw-r--r-- | test/functional/autocmd/autocmd_spec.lua | 25 | ||||
| -rw-r--r-- | test/functional/autocmd/cmdline_spec.lua | 46 | ||||
| -rw-r--r-- | test/functional/autocmd/show_spec.lua | 14 |
4 files changed, 35 insertions, 60 deletions
diff --git a/test/functional/autocmd/autocmd_oldtest_spec.lua b/test/functional/autocmd/autocmd_oldtest_spec.lua index 1a3b723ac2..5e4beb7684 100644 --- a/test/functional/autocmd/autocmd_oldtest_spec.lua +++ b/test/functional/autocmd/autocmd_oldtest_spec.lua @@ -103,9 +103,9 @@ describe('oldtests', function() it('no ml_get error with TextChanged autocommand and delete', function() local screen = Screen.new(75, 10) screen:attach() - screen:set_default_attr_ids({ - [1] = { background = Screen.colors.Cyan }, - }) + screen:add_extra_attr_ids { + [100] = { background = Screen.colors.Cyan1 }, + } exec([[ set noshowcmd noruler scrolloff=0 source test/old/testdir/samples/matchparen.vim @@ -120,9 +120,9 @@ describe('oldtests', function() } | const auto &themes = _forPeer->owner().cloudThemes(); | const auto theme = themes.themeForEmoji(themeEmoji); | - if (!theme) {1:{} | + if (!theme) {100:{} | return nonCustom; | - {1:^}} | + {100:^}} | 353 fewer lines | ]], } diff --git a/test/functional/autocmd/autocmd_spec.lua b/test/functional/autocmd/autocmd_spec.lua index fbaf0c0dbf..0429cfee89 100644 --- a/test/functional/autocmd/autocmd_spec.lua +++ b/test/functional/autocmd/autocmd_spec.lua @@ -259,15 +259,6 @@ describe('autocmd', function() local screen = Screen.new(50, 10) screen:attach() - screen:set_default_attr_ids({ - [1] = { bold = true, foreground = Screen.colors.Blue1 }, - [2] = { background = Screen.colors.LightMagenta }, - [3] = { - background = Screen.colors.LightMagenta, - bold = true, - foreground = Screen.colors.Blue1, - }, - }) source([[ function! Doit() @@ -292,8 +283,8 @@ describe('autocmd', function() feed(':enew | doautoall User<cr>') screen:expect([[ - {2:bb }| - {3:~ }|*4 + {4:bb }| + {11:~ }|*4 {1:~ }|*4 ^:enew | doautoall User | ]]) @@ -318,8 +309,8 @@ describe('autocmd', function() command('let g:had_value = v:null') feed(':doautoall User<cr>') screen:expect([[ - {2:bb }| - {3:~ }|*4 + {4:bb }| + {11:~ }|*4 {1:~ }|*4 ^:doautoall User | ]]) @@ -343,11 +334,6 @@ describe('autocmd', function() it('`aucmd_win` cannot be changed into a normal window #13699', function() local screen = Screen.new(50, 10) screen:attach() - screen:set_default_attr_ids { - [1] = { bold = true, foreground = Screen.colors.Blue1 }, - [2] = { reverse = true }, - [3] = { bold = true, reverse = true }, - } -- Create specific layout and ensure it's left unchanged. -- Use vim._with on a hidden buffer so aucmd_win is used. @@ -513,9 +499,6 @@ describe('autocmd', function() it(':doautocmd does not warn "No matching autocommands" #10689', function() local screen = Screen.new(32, 3) screen:attach() - screen:set_default_attr_ids({ - [1] = { bold = true, foreground = Screen.colors.Blue1 }, - }) feed(':doautocmd User Foo<cr>') screen:expect { diff --git a/test/functional/autocmd/cmdline_spec.lua b/test/functional/autocmd/cmdline_spec.lua index ad3bc3576f..ca137debb8 100644 --- a/test/functional/autocmd/cmdline_spec.lua +++ b/test/functional/autocmd/cmdline_spec.lua @@ -61,12 +61,6 @@ describe('cmdline autocommands', function() clear() local screen = Screen.new(72, 8) screen:attach() - screen:set_default_attr_ids({ - [1] = { bold = true, foreground = Screen.colors.Blue1 }, - [2] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red }, - [3] = { bold = true, foreground = Screen.colors.SeaGreen4 }, - [4] = { bold = true, reverse = true }, - }) command("autocmd CmdlineEnter * echoerr 'FAIL'") command("autocmd CmdlineLeave * echoerr 'very error'") @@ -74,22 +68,22 @@ describe('cmdline autocommands', function() screen:expect([[ | {1:~ }|*3 - {4: }| + {3: }| : | - {2:CmdlineEnter Autocommands for "*": Vim(echoerr):FAIL} | + {9:CmdlineEnter Autocommands for "*": Vim(echoerr):FAIL} | :^ | ]]) feed("put ='lorem ipsum'<cr>") screen:expect([[ | - {4: }| + {3: }| : | - {2:CmdlineEnter Autocommands for "*": Vim(echoerr):FAIL} | + {9:CmdlineEnter Autocommands for "*": Vim(echoerr):FAIL} | :put ='lorem ipsum' | - {2:CmdlineLeave Autocommands for "*": Vim(echoerr):very error} | + {9:CmdlineLeave Autocommands for "*": Vim(echoerr):very error} | | - {3:Press ENTER or type command to continue}^ | + {6:Press ENTER or type command to continue}^ | ]]) -- cmdline was still executed @@ -108,11 +102,11 @@ describe('cmdline autocommands', function() screen:expect([[ | lorem ipsum | - {4: }| + {3: }| : | - {2:CmdlineEnter Autocommands for "*": Vim(echoerr):FAIL} | + {9:CmdlineEnter Autocommands for "*": Vim(echoerr):FAIL} | :put ='lorem ipsum' | - {2:CmdlineChanged Autocommands for "*": Vim(echoerr):change erreor} | + {9:CmdlineChanged Autocommands for "*": Vim(echoerr):change erreor} | :put ='lorem ipsum'^ | ]]) @@ -120,37 +114,37 @@ describe('cmdline autocommands', function() screen:expect([[ | lorem ipsum | - {4: }| + {3: }| : | - {2:CmdlineEnter Autocommands for "*": Vim(echoerr):FAIL} | + {9:CmdlineEnter Autocommands for "*": Vim(echoerr):FAIL} | :put ='lorem ipsum' | - {2:CmdlineChanged Autocommands for "*": Vim(echoerr):change erreor} | + {9:CmdlineChanged Autocommands for "*": Vim(echoerr):change erreor} | :put ='lorem ipsum^' | ]]) -- edit still works feed('.') screen:expect([[ - {4: }| + {3: }| : | - {2:CmdlineEnter Autocommands for "*": Vim(echoerr):FAIL} | + {9:CmdlineEnter Autocommands for "*": Vim(echoerr):FAIL} | :put ='lorem ipsum' | - {2:CmdlineChanged Autocommands for "*": Vim(echoerr):change erreor} | + {9:CmdlineChanged Autocommands for "*": Vim(echoerr):change erreor} | :put ='lorem ipsum.' | - {2:CmdlineChanged Autocommands for "*": Vim(echoerr):change erreor} | + {9:CmdlineChanged Autocommands for "*": Vim(echoerr):change erreor} | :put ='lorem ipsum.^' | ]]) feed('<cr>') screen:expect([[ :put ='lorem ipsum' | - {2:CmdlineChanged Autocommands for "*": Vim(echoerr):change erreor} | + {9:CmdlineChanged Autocommands for "*": Vim(echoerr):change erreor} | :put ='lorem ipsum.' | - {2:CmdlineChanged Autocommands for "*": Vim(echoerr):change erreor} | + {9:CmdlineChanged Autocommands for "*": Vim(echoerr):change erreor} | :put ='lorem ipsum.' | - {2:CmdlineLeave Autocommands for "*": Vim(echoerr):very error} | + {9:CmdlineLeave Autocommands for "*": Vim(echoerr):very error} | | - {3:Press ENTER or type command to continue}^ | + {6:Press ENTER or type command to continue}^ | ]]) -- cmdline was still executed diff --git a/test/functional/autocmd/show_spec.lua b/test/functional/autocmd/show_spec.lua index 7e1818c4fd..10d242527f 100644 --- a/test/functional/autocmd/show_spec.lua +++ b/test/functional/autocmd/show_spec.lua @@ -43,11 +43,9 @@ describe(':autocmd', function() it('should not show group information if interrupted', function() local screen = Screen.new(50, 6) - screen:set_default_attr_ids({ - [1] = { bold = true, foreground = Screen.colors.Blue1 }, -- NonText - [2] = { bold = true, foreground = Screen.colors.SeaGreen }, -- MoreMsg - [3] = { bold = true, foreground = Screen.colors.Magenta }, -- Title - }) + screen:add_extra_attr_ids { + [100] = { foreground = Screen.colors.Magenta, bold = true }, + } screen:attach() exec([[ set more @@ -73,11 +71,11 @@ describe(':autocmd', function() feed(':autocmd<CR>') screen:expect([[ :autocmd | - {3:--- Autocommands ---} | - {3:test_1} {3:BufEnter} | + {100:--- Autocommands ---} | + {100:test_1} {100:BufEnter} | A echo 'A' | B echo 'B' | - {2:-- More --}^ | + {6:-- More --}^ | ]]) feed('q') screen:expect([[ |