Skip to content

Commit 67d7815

Browse files
committed
ci: added tests for #2185
1 parent e68305d commit 67d7815

24 files changed

Lines changed: 161 additions & 19 deletions

File tree

tests/api_spec.lua

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,32 @@ T["api"]["fzf_exec"]["rg"] = new_set({ parametrize = { { true }, { false }, { 1
6262
end
6363
})
6464

65+
T["api"]["fzf_exec"]["fn_transform"] = new_set({ parametrize = { { true }, { false } } })
66+
67+
T["api"]["fzf_exec"]["fn_transform"]["filter"] = new_set(
68+
{ parametrize = { { 13 }, { 24 } } }, {
69+
function(multiprocess, filter)
70+
helpers.FzfLua.fzf_exec(child,
71+
[['echo "one\ntwo\nthree\nfour"']],
72+
{
73+
-- __postprocess_wait = multiprocess ~= 1,
74+
__expect_lines = true,
75+
multiprocess = multiprocess,
76+
fn_transform = filter == 13
77+
and
78+
function(item)
79+
if vim.tbl_contains({ "one", "three" }, item) then return end
80+
return "TRANSFORMED: " .. item
81+
end
82+
or
83+
function(item)
84+
if vim.tbl_contains({ "two", "four" }, item) then return end
85+
return "TRANSFORMED: " .. item
86+
end
87+
})
88+
end
89+
})
90+
6591

6692
T["api"]["fzf_live"] = new_set()
6793

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
--|---------|---------|---------|---------|---------|---------|----
2+
01|
3+
02|~
4+
03|~ ╭─────────────────────────────────────────────────╮
5+
04|~ │> 2/2 │
6+
05|~ │──────────────────────────────────────────────── │
7+
06|~ │▌ TRANSFORMED: two │
8+
07|~ │ TRANSFORMED: four │
9+
08|~ │ │
10+
09|~ │ │
11+
10|~ │ │
12+
11|~ │ │
13+
12|~ │ │
14+
13|~ │ │
15+
14|~ │ │
16+
15|~ │ │
17+
16|~ │ │
18+
17|~ │ │
19+
18|~ │ │
20+
19|~ │ │
21+
20|~ │ │
22+
21|~ │ │
23+
22|~ ╰─────────────────────────────────────────────────╯
24+
23|~
25+
24|[No Name] 0,0-1 All
26+
25|
27+
26|
28+
27|
29+
28|-- TERMINAL -- 1,0-1 All
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
--|---------|---------|---------|---------|---------|---------|----
2+
01|
3+
02|~
4+
03|~ ╭─────────────────────────────────────────────────╮
5+
04|~ │> 2/2 │
6+
05|~ │──────────────────────────────────────────────── │
7+
06|~ │▌ TRANSFORMED: one │
8+
07|~ │ TRANSFORMED: three │
9+
08|~ │ │
10+
09|~ │ │
11+
10|~ │ │
12+
11|~ │ │
13+
12|~ │ │
14+
13|~ │ │
15+
14|~ │ │
16+
15|~ │ │
17+
16|~ │ │
18+
17|~ │ │
19+
18|~ │ │
20+
19|~ │ │
21+
20|~ │ │
22+
21|~ │ │
23+
22|~ ╰─────────────────────────────────────────────────╯
24+
23|~
25+
24|[No Name] 0,0-1 All
26+
25|
27+
26|
28+
27|
29+
28|-- TERMINAL -- 1,0-1 All
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
--|---------|---------|---------|---------|---------|---------|----
2+
01|
3+
02|~
4+
03|~ ╭─────────────────────────────────────────────────╮
5+
04|~ │> 2/2 │
6+
05|~ │──────────────────────────────────────────────── │
7+
06|~ │▌ TRANSFORMED: two │
8+
07|~ │ TRANSFORMED: four │
9+
08|~ │ │
10+
09|~ │ │
11+
10|~ │ │
12+
11|~ │ │
13+
12|~ │ │
14+
13|~ │ │
15+
14|~ │ │
16+
15|~ │ │
17+
16|~ │ │
18+
17|~ │ │
19+
18|~ │ │
20+
19|~ │ │
21+
20|~ │ │
22+
21|~ │ │
23+
22|~ ╰─────────────────────────────────────────────────╯
24+
23|~
25+
24|[No Name] 0,0-1 All
26+
25|
27+
26|
28+
27|
29+
28|-- TERMINAL -- 1,0-1 All
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
--|---------|---------|---------|---------|---------|---------|----
2+
01|
3+
02|~
4+
03|~ ╭─────────────────────────────────────────────────╮
5+
04|~ │> 2/2 │
6+
05|~ │──────────────────────────────────────────────── │
7+
06|~ │▌ TRANSFORMED: one │
8+
07|~ │ TRANSFORMED: three │
9+
08|~ │ │
10+
09|~ │ │
11+
10|~ │ │
12+
11|~ │ │
13+
12|~ │ │
14+
13|~ │ │
15+
14|~ │ │
16+
15|~ │ │
17+
16|~ │ │
18+
17|~ │ │
19+
18|~ │ │
20+
19|~ │ │
21+
20|~ │ │
22+
21|~ │ │
23+
22|~ ╰─────────────────────────────────────────────────╯
24+
23|~
25+
24|[No Name] 0,0-1 All
26+
25|
27+
26|
28+
27|
29+
28|-- TERMINAL -- 1,0-1 All

tests/screenshots/tests-api_spec.lua---api---fzf_exec---rg---1-+-args-{-1-}

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
01|
33
02|~
44
03|~ ╭─────────────────────────────────────────────────╮
5-
04|~ │> 123/123
5+
04|~ │> 127/127
66
05|~ │──────────────────────────────────────────────── │
77
06|~ │▌ LICENSE ││
88
07|~ │ Makefile ││

tests/screenshots/tests-api_spec.lua---api---fzf_exec---rg---1-+-args-{-false-}

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
01|
33
02|~
44
03|~ ╭─────────────────────────────────────────────────╮
5-
04|~ │> 124/124
5+
04|~ │> 128/128
66
05|~ │──────────────────────────────────────────────── │
77
06|~ │▌ [DEBUG] [st] rg --files -g "!.git" --sort=path││
88
07|~ │ LICENSE ││

tests/screenshots/tests-api_spec.lua---api---fzf_exec---rg---1-+-args-{-true-}

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
01|
33
02|~
44
03|~ ╭─────────────────────────────────────────────────╮
5-
04|~ │> 124/124
5+
04|~ │> 128/128
66
05|~ │──────────────────────────────────────────────── │
77
06|~ │▌ [DEBUG] [mt] rg --files -g "!.git" --sort=path││
88
07|~ │ LICENSE ││

tests/screenshots/tests-file-ui_spec.lua---files---close-abort---1-+-args-{-'-c-c-'-}

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
01|
33
02|~
44
03|~ ╭───────────────────── Files ─────────────────────╮
5-
04|~ │> 124/124 (0) │
5+
04|~ │> 128/128 (0) │
66
05|~ │──────────────────────────────────────────────── │
77
06|~ │▌ [DEBUG] [mt] rg --files --sort=path ││
88
07|~ │ LICENSE ││

tests/screenshots/tests-file-ui_spec.lua---files---close-abort---1-+-args-{-'-esc-'-}

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
01|
33
02|~
44
03|~ ╭───────────────────── Files ─────────────────────╮
5-
04|~ │> 124/124 (0) │
5+
04|~ │> 128/128 (0) │
66
05|~ │──────────────────────────────────────────────── │
77
06|~ │▌ [DEBUG] [mt] rg --files --sort=path ││
88
07|~ │ LICENSE ││

0 commit comments

Comments
 (0)