| File tests/misc/normal.c changed (mode: 100644) (index 7b993f8e6..3d71e8ab5) |
| 13 |
13 |
#include "../../src/modes/cmdline.h" |
#include "../../src/modes/cmdline.h" |
| 14 |
14 |
#include "../../src/modes/modes.h" |
#include "../../src/modes/modes.h" |
| 15 |
15 |
#include "../../src/modes/wk.h" |
#include "../../src/modes/wk.h" |
|
16 |
|
#include "../../src/ui/statusbar.h" |
| 16 |
17 |
#include "../../src/ui/ui.h" |
#include "../../src/ui/ui.h" |
| 17 |
18 |
#include "../../src/utils/fs.h" |
#include "../../src/utils/fs.h" |
| 18 |
19 |
#include "../../src/utils/str.h" |
#include "../../src/utils/str.h" |
| 19 |
20 |
#include "../../src/filelist.h" |
#include "../../src/filelist.h" |
| 20 |
21 |
#include "../../src/flist_sel.h" |
#include "../../src/flist_sel.h" |
| 21 |
22 |
#include "../../src/fops_common.h" |
#include "../../src/fops_common.h" |
|
23 |
|
#include "../../src/registers.h" |
| 22 |
24 |
#include "../../src/status.h" |
#include "../../src/status.h" |
| 23 |
25 |
|
|
| 24 |
26 |
#include "utils.h" |
#include "utils.h" |
| |
| ... |
... |
TEST(lb_rb_S) |
| 244 |
246 |
assert_int_equal(0, lwin.list_pos); |
assert_int_equal(0, lwin.list_pos); |
| 245 |
247 |
} |
} |
| 246 |
248 |
|
|
|
249 |
|
TEST(selection_is_primary) |
|
250 |
|
{ |
|
251 |
|
regs_init(); |
|
252 |
|
|
|
253 |
|
make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), TEST_DATA_PATH, "read", |
|
254 |
|
cwd); |
|
255 |
|
populate_dir_list(&lwin, /*reload=*/0); |
|
256 |
|
|
|
257 |
|
assert_int_equal(0, lwin.list_pos); |
|
258 |
|
lwin.dir_entry[1].selected = 1; |
|
259 |
|
lwin.selected_files = 1; |
|
260 |
|
|
|
261 |
|
const reg_t *def_reg = regs_find(DEFAULT_REG_NAME); |
|
262 |
|
|
|
263 |
|
cfg.selection_is_primary = 1; |
|
264 |
|
(void)vle_keys_exec_timed_out(L"yy"); |
|
265 |
|
assert_int_equal(1, def_reg->nfiles); |
|
266 |
|
assert_string_ends_with("/dos-eof", def_reg->files[0]); |
|
267 |
|
|
|
268 |
|
cfg.selection_is_primary = 0; |
|
269 |
|
(void)vle_keys_exec_timed_out(L"yy"); |
|
270 |
|
assert_int_equal(1, def_reg->nfiles); |
|
271 |
|
assert_string_ends_with("/binary-data", def_reg->files[0]); |
|
272 |
|
|
|
273 |
|
regs_reset(); |
|
274 |
|
} |
|
275 |
|
|
|
276 |
|
TEST(yy_one_file) |
|
277 |
|
{ |
|
278 |
|
regs_init(); |
|
279 |
|
|
|
280 |
|
make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), TEST_DATA_PATH, "read", |
|
281 |
|
cwd); |
|
282 |
|
populate_dir_list(&lwin, /*reload=*/0); |
|
283 |
|
|
|
284 |
|
const reg_t *def_reg = regs_find(DEFAULT_REG_NAME); |
|
285 |
|
|
|
286 |
|
ui_sb_msg(""); |
|
287 |
|
(void)vle_keys_exec_timed_out(L"yy"); |
|
288 |
|
assert_string_equal("1 item yanked", ui_sb_last()); |
|
289 |
|
assert_int_equal(1, def_reg->nfiles); |
|
290 |
|
assert_string_ends_with("/binary-data", def_reg->files[0]); |
|
291 |
|
|
|
292 |
|
regs_reset(); |
|
293 |
|
} |
|
294 |
|
|
|
295 |
|
TEST(yy_adjacent_files) |
|
296 |
|
{ |
|
297 |
|
regs_init(); |
|
298 |
|
|
|
299 |
|
make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), TEST_DATA_PATH, "read", |
|
300 |
|
cwd); |
|
301 |
|
populate_dir_list(&lwin, /*reload=*/0); |
|
302 |
|
|
|
303 |
|
const reg_t *def_reg = regs_find(DEFAULT_REG_NAME); |
|
304 |
|
|
|
305 |
|
ui_sb_msg(""); |
|
306 |
|
(void)vle_keys_exec_timed_out(L"3yy"); |
|
307 |
|
assert_int_equal(3, def_reg->nfiles); |
|
308 |
|
assert_string_equal("3 items yanked", ui_sb_last()); |
|
309 |
|
assert_string_ends_with("/binary-data", def_reg->files[0]); |
|
310 |
|
assert_string_ends_with("/dos-eof", def_reg->files[1]); |
|
311 |
|
assert_string_ends_with("/dos-line-endings", def_reg->files[2]); |
|
312 |
|
|
|
313 |
|
regs_reset(); |
|
314 |
|
} |
|
315 |
|
|
| 247 |
316 |
TEST(gf, IF(not_windows)) |
TEST(gf, IF(not_windows)) |
| 248 |
317 |
{ |
{ |
| 249 |
318 |
char dir_path[PATH_MAX + 1]; |
char dir_path[PATH_MAX + 1]; |