File tests/misc/running.c changed (mode: 100644) (index 7b5fcd0ea..88d8a0d6a) |
28 |
28 |
static int prog_exists(const char name[]); |
static int prog_exists(const char name[]); |
29 |
29 |
static void start_use_script(void); |
static void start_use_script(void); |
30 |
30 |
static void stop_use_script(void); |
static void stop_use_script(void); |
31 |
|
static void assoc_a(char macro); |
|
32 |
|
static void assoc_b(char macro); |
|
33 |
|
static void assoc_common(void); |
|
|
31 |
|
static void assoc_script(const char pattern[], const char param[], char macro); |
34 |
32 |
|
|
35 |
33 |
static char cwd[PATH_MAX + 1]; |
static char cwd[PATH_MAX + 1]; |
36 |
34 |
static char script_path[PATH_MAX + 1]; |
static char script_path[PATH_MAX + 1]; |
|
... |
... |
TEST(selection_uses_vim_on_all_undefs, IF(not_windows)) |
215 |
213 |
TEST(selection_uses_vim_on_at_least_one_undef_non_current, IF(not_windows)) |
TEST(selection_uses_vim_on_at_least_one_undef_non_current, IF(not_windows)) |
216 |
214 |
{ |
{ |
217 |
215 |
start_use_script(); |
start_use_script(); |
218 |
|
assoc_a('c'); |
|
|
216 |
|
assoc_script("{a}", "a", 'c'); |
219 |
217 |
|
|
220 |
218 |
rn_open(&lwin, FHE_NO_RUN); |
rn_open(&lwin, FHE_NO_RUN); |
221 |
219 |
|
|
|
... |
... |
TEST(selection_uses_vim_on_at_least_one_undef_non_current, IF(not_windows)) |
231 |
229 |
TEST(selection_uses_vim_on_at_least_one_undef_current, IF(not_windows)) |
TEST(selection_uses_vim_on_at_least_one_undef_current, IF(not_windows)) |
232 |
230 |
{ |
{ |
233 |
231 |
start_use_script(); |
start_use_script(); |
234 |
|
assoc_b('c'); |
|
|
232 |
|
assoc_script("{b}", "b", 'c'); |
235 |
233 |
|
|
236 |
234 |
rn_open(&lwin, FHE_NO_RUN); |
rn_open(&lwin, FHE_NO_RUN); |
237 |
235 |
|
|
|
... |
... |
TEST(selection_uses_vim_on_at_least_one_undef_current, IF(not_windows)) |
247 |
245 |
TEST(selection_uses_common_handler, IF(not_windows)) |
TEST(selection_uses_common_handler, IF(not_windows)) |
248 |
246 |
{ |
{ |
249 |
247 |
start_use_script(); |
start_use_script(); |
250 |
|
assoc_common(); |
|
|
248 |
|
assoc_script("{a,b}", "common", 'f'); |
251 |
249 |
|
|
252 |
250 |
rn_open(&lwin, FHE_NO_RUN); |
rn_open(&lwin, FHE_NO_RUN); |
253 |
251 |
|
|
|
... |
... |
TEST(selection_uses_common_handler, IF(not_windows)) |
263 |
261 |
TEST(selection_is_incompatible, IF(not_windows)) |
TEST(selection_is_incompatible, IF(not_windows)) |
264 |
262 |
{ |
{ |
265 |
263 |
start_use_script(); |
start_use_script(); |
266 |
|
assoc_a('c'); |
|
267 |
|
assoc_b('f'); |
|
|
264 |
|
assoc_script("{a}", "a", 'c'); |
|
265 |
|
assoc_script("{b}", "b", 'f'); |
268 |
266 |
|
|
269 |
267 |
rn_open(&lwin, FHE_NO_RUN); |
rn_open(&lwin, FHE_NO_RUN); |
270 |
268 |
|
|
|
... |
... |
stop_use_script(void) |
672 |
670 |
} |
} |
673 |
671 |
|
|
674 |
672 |
static void |
static void |
675 |
|
assoc_a(char macro) |
|
|
673 |
|
assoc_script(const char pattern[], const char param[], char macro) |
676 |
674 |
{ |
{ |
677 |
675 |
char cmd[PATH_MAX + 1]; |
char cmd[PATH_MAX + 1]; |
678 |
|
snprintf(cmd, sizeof(cmd), "%s a %%%c", script_path, macro); |
|
679 |
|
assoc_programs("{a}", cmd, 0, 0); |
|
680 |
|
} |
|
681 |
|
|
|
682 |
|
static void |
|
683 |
|
assoc_b(char macro) |
|
684 |
|
{ |
|
685 |
|
char cmd[PATH_MAX + 1]; |
|
686 |
|
snprintf(cmd, sizeof(cmd), "%s b %%%c", script_path, macro); |
|
687 |
|
assoc_programs("{b}", cmd, 0, 0); |
|
688 |
|
} |
|
689 |
|
|
|
690 |
|
static void |
|
691 |
|
assoc_common(void) |
|
692 |
|
{ |
|
693 |
|
char cmd[PATH_MAX + 1]; |
|
694 |
|
snprintf(cmd, sizeof(cmd), "%s common %%f", script_path); |
|
695 |
|
assoc_programs("{a,b}", cmd, 0, 0); |
|
|
676 |
|
snprintf(cmd, sizeof(cmd), "%s %s %%%c", script_path, param, macro); |
|
677 |
|
assoc_programs(pattern, cmd, 0, 0); |
696 |
678 |
} |
} |
697 |
679 |
|
|
698 |
680 |
/* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ |
/* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ |