Skip to content

Commit fd5265d

Browse files
committed
test(files): test content.highlight screenshots only on Neovim>=0.12
Details: - On Neovim>=0.12 the window-local `Normal` group (which is the tested `MiniFilesNormal` for explorer windows) blends background with cursorline. Which means that it will not be visible under it.
1 parent 6bd3a01 commit fd5265d

File tree

2 files changed

+21
-15
lines changed

2 files changed

+21
-15
lines changed

tests/screenshots/tests-test_files.lua---open()---respects-`content.highlight`

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@
1717

1818
--|---------|---------|---------|---------|---------|---------|---------|---------|
1919
01|01111111111111111111111111111111110000000000000000002222222222222222222222222222
20-
02|03344444455555555555555555555555555555555555555555506666666666666666666666666666
21-
03|07744444444444444444444444444444444444444444444444406666666666666666666666666666
22-
04|07744444444444444444444444444444444444444444444444406666666666666666666666666666
23-
05|04444444444444444444444444444444444444444444444444406666666666666666666666666666
24-
06|04444444444444444444444444444444444444444444444444406666666666666666666666666666
25-
07|04444444444444444444444444444444444444444444444444406666666666666666666666666666
26-
08|04444444444444444444444444444444444444444444444444406666666666666666666666666666
27-
09|00000000000000000000000000000000000000000000000000006666666666666666666666666666
28-
10|66666666666666666666666666666666666666666666666666666666666666666666666666666666
29-
11|66666666666666666666666666666666666666666666666666666666666666666666666666666666
30-
12|66666666666666666666666666666666666666666666666666666666666666666666666666666666
31-
13|66666666666666666666666666666666666666666666666666666666666666666666666666666666
32-
14|66666666666666666666666666666666666666666666666666666666666666666666666666666666
20+
02|03344444444444444444444444444444444444444444444444405555555555555555555555555555
21+
03|06677777777777777777777777777777777777777777777777705555555555555555555555555555
22+
04|06677777777777777777777777777777777777777777777777705555555555555555555555555555
23+
05|07777777777777777777777777777777777777777777777777705555555555555555555555555555
24+
06|07777777777777777777777777777777777777777777777777705555555555555555555555555555
25+
07|07777777777777777777777777777777777777777777777777705555555555555555555555555555
26+
08|07777777777777777777777777777777777777777777777777705555555555555555555555555555
27+
09|00000000000000000000000000000000000000000000000000005555555555555555555555555555
28+
10|55555555555555555555555555555555555555555555555555555555555555555555555555555555
29+
11|55555555555555555555555555555555555555555555555555555555555555555555555555555555
30+
12|55555555555555555555555555555555555555555555555555555555555555555555555555555555
31+
13|55555555555555555555555555555555555555555555555555555555555555555555555555555555
32+
14|55555555555555555555555555555555555555555555555555555555555555555555555555555555
3333
15|22222222222222222222222222222222222222222222222222222222222222222222222222222222

tests/test_files.lua

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -658,8 +658,14 @@ T['open()']['respects `content.highlight`'] = function()
658658
end
659659
]])
660660

661+
local expect_screenshot = function()
662+
-- Test only on Neovim>=0.12 because there window-local `Normal` (which is
663+
-- `MiniFilesNormal` here) blends background with cursorline
664+
if child.fn.has('nvim-0.12') == 1 then child.expect_screenshot() end
665+
end
666+
661667
open(test_dir_path)
662-
child.expect_screenshot()
668+
expect_screenshot()
663669
validate_fs_entry(child.lua_get('_G.highlight_arg'))
664670

665671
-- Local value from argument should take precedence
@@ -672,7 +678,7 @@ T['open()']['respects `content.highlight`'] = function()
672678
vim.inspect(test_dir_path)
673679
)
674680
child.lua(lua_cmd)
675-
child.expect_screenshot()
681+
expect_screenshot()
676682
end
677683

678684
T['open()']['respects `content.prefix`'] = function()

0 commit comments

Comments
 (0)