@@ -32,7 +32,7 @@ T["files"]["close|abort"] = new_set({ parametrize = { { "<esc>" }, { "<c-c>" } }
3232 previewer = false ,
3333 cwd_prompt = false ,
3434 multiprocess = true ,
35- cmd = " rg --files --sort=path" ,
35+ cmd = " rg --files --sort=path -g !tests/** " ,
3636 })
3737 end ,
3838})
@@ -47,7 +47,7 @@ T["files"]["multiprocess"] = new_set({ parametrize = { { false }, { true } } },
4747 previewer = false ,
4848 cwd_prompt = false ,
4949 multiprocess = multiprocess ,
50- cmd = " rg --files --sort=path" ,
50+ cmd = " rg --files --sort=path -g !tests/** " ,
5151 })
5252 end ,
5353})
@@ -66,12 +66,15 @@ T["files"]["previewer"]["builtin"] = new_set({ parametrize = { { "ci" }, { "buil
6666 end
6767 helpers .FzfLua .files (child , {
6868 __expect_lines = true ,
69+ __screen_opts = helpers .IS_WIN ()
70+ -- Ignore debug command due to ^! escape sequence on Win
71+ and { ignore_text = { 6 , 28 }, normalize_paths = true } or nil ,
6972 debug = 1 ,
7073 hidden = false ,
7174 file_icons = icons ,
7275 cwd_prompt = false ,
7376 multiprocess = true ,
74- cmd = " rg --files --sort=path" ,
77+ cmd = " rg --files --sort=path -g !tests/** " ,
7578 winopts = { preview = { scrollbar = false } },
7679 previewer = previewer == " builtin"
7780 and " builtin"
@@ -107,7 +110,7 @@ T["files"]["icons"]["defaults"] = new_set({ parametrize = { { "+attrs" }, { "-at
107110 previewer = false ,
108111 cwd_prompt = false ,
109112 file_icons = icons ,
110- cmd = " rg --files --sort=path" ,
113+ cmd = " rg --files --sort=path -g !tests/** " ,
111114 })
112115 end ,
113116})
@@ -119,17 +122,18 @@ T["files"]["executable"] = new_set({ parametrize = { { "fd" }, { "rg" }, { "find
119122 local opts , exclude
120123 if exec == " fd" then
121124 exclude = " {}"
122- opts = { fd_opts = " --color=never --type f --type l --exclude .git | sort" }
125+ opts = {
126+ fd_opts = " --color=never --type f --type l --exclude .git --exclude tests | sort" }
123127 elseif exec == " rg" then
124128 exclude = [[ { "fd", "fdfind" }]]
125- opts = { rg_opts = ' --files -g "!.git" --sort=path' }
129+ opts = { rg_opts = ' --files -g "!.git" --sort=path -g !tests/** ' }
126130 else
127131 exclude = [[ { "fd", "fdfind", "rg" }]]
128132 opts = {
129133 find_opts =
130- [[ -type f \! -path '*/.git/*' \! -path '*/doc/tags' \! -path '*/deps/*' | sort]] ,
134+ [[ -type f \! -path '*/.git/*' \! -path '*/doc/tags' \! -path '*/deps/*' ! -path '*/tests/*' | sort]] ,
131135 dir_opts =
132- [[ /s/b/a:-d | findstr -v "\.git\\" | findstr -v "doc\\tags" | findstr -v "deps" | sort]] ,
136+ [[ /s/b/a:-d | findstr -v "\.git\\" | findstr -v "doc\\tags" | findstr -v "deps" | findstr -v "tests" | sort]] ,
133137 strip_cwd_prefix = true
134138 }
135139 end
@@ -160,17 +164,20 @@ T["files"]["executable"] = new_set({ parametrize = { { "fd" }, { "rg" }, { "find
160164T [" files" ][" preview should work after chdir #1864" ] = function ()
161165 -- Ignore last "-- TERMINAL --" line and "[DEBUG]" line containing the cmd
162166 local screen_opts = { ignore_text = { 6 , 28 }, normalize_paths = helpers .IS_WIN () }
163- eq (child .lua_get ([[ _G._fzf_lua_on_create]] ), vim .NIL )
164- child .lua ([[ FzfLua.files {
167+ helpers .FzfLua .files (child , {
168+ __expect_lines = true ,
169+ __screen_opts = screen_opts ,
170+ cmd = " rg --files --sort=path -g !tests/**" ,
171+ hidden = false ,
165172 cwd_prompt = false ,
166- previewer = ' builtin' ,
167- winopts = { preview = { hidden = false } }
168- } ]] )
169- child . wait_until ( function () return child .lua_get ([[ _G._fzf_load_called ]] ) == true end )
170- child .lua ([[ vim.cmd.cd("./tests") ]] )
171- child . type_keys ( [[ <c-n> ]] )
172- sleep ( 100 )
173- child . expect_screen_lines ( screen_opts )
173+ previewer = " builtin" ,
174+ winopts = { preview = { hidden = false } },
175+ __after_open = function ( )
176+ child .lua ([[ vim.cmd.cd("./tests") ]] )
177+ child .type_keys ([[ <c-n> ]] )
178+ sleep ( 100 )
179+ end
180+ } )
174181end
175182
176183return T
0 commit comments