xaizek / vifm (License: GPLv2+) (since 2018-12-07)
Vifm is a file manager with curses interface, which provides Vi[m]-like environment for managing objects within file systems, extended with some useful ideas from mutt.
Commit 57cdab646dd4c08ee703b092fe5bcf82632e7d77

Test p and P keys in normal mode
Author: xaizek
Author date (UTC): 2026-03-11 22:07
Committer name: xaizek
Committer date (UTC): 2026-03-11 22:20
Parent(s): 0de9461e78936b55ccb0bdcd1f6958bb4cce30f0
Signing key: 99DC5E4DB05F6BE2
Tree: c33e9e4f8671cd67c7e2a54b5cb1a5744ef8bd89
File Lines added Lines deleted
tests/misc/normal.c 42 0
File tests/misc/normal.c changed (mode: 100644) (index 7d769c939..1212a6772)
... ... TEST(yy_adjacent_files)
314 314 regs_reset(); regs_reset();
315 315 } }
316 316
317 TEST(p_P, REPEAT(2))
318 {
319 const int p = (STIC_TEST_PARAM == 0);
320
321 regs_init();
322 undo_setup();
323
324 create_dir(SANDBOX_PATH "/src");
325 create_file(SANDBOX_PATH "/src/file");
326
327 make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), SANDBOX_PATH, "src", cwd);
328 populate_dir_list(&lwin, /*reload=*/0);
329 (void)vle_keys_exec_timed_out(L"yy");
330
331 make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), SANDBOX_PATH, "", cwd);
332 populate_dir_list(&lwin, /*reload=*/0);
333
334 ui_sb_msg("");
335 (void)vle_keys_exec_timed_out(p ? L"p" : L"P");
336 assert_success(chdir(cwd));
337
338 if(p)
339 {
340 assert_string_equal("1 item copied", ui_sb_last());
341
342 remove_file(SANDBOX_PATH "/src/file");
343 remove_file(SANDBOX_PATH "/file");
344 }
345 else
346 {
347 assert_string_equal("1 item moved", ui_sb_last());
348
349 no_remove_file(SANDBOX_PATH "/src/file");
350 remove_file(SANDBOX_PATH "/file");
351 }
352
353 remove_dir(SANDBOX_PATH "/src");
354
355 regs_reset();
356 undo_teardown();
357 }
358
317 359 TEST(gf, IF(not_windows)) TEST(gf, IF(not_windows))
318 360 { {
319 361 char dir_path[PATH_MAX + 1]; char dir_path[PATH_MAX + 1];
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/vifm

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/vifm

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master