1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2026-01-15 09:41:07 +00:00
uutils-coreutils/tests/by-util
Kai M 42b9b7b62c
install: fix issue #3814 (#3950)
* install: fix installing one file when using -Dt options

* install: fix installing multiple files with -Dt

Code was missing the logic to create the target dir when multiple files
should be copied and target dir is given by -t option.
This simplifies the copy logic also when only one file should be copied
to the target dir.

* install: fix verbose output when using -D

Also adds a unit test to verify the same behaviour as the gnu tools.

* install: add more testcases for create leading dir

Tests various combinations of "-D" with and w/o "-t" when installing
either a single file or multiple files into a non existing directory.

  install -D file1 file2 (-t) not_existing_dir
  install -D file1 (-t) not_existing_dir/

Also fixes file formatting, spelling and adds some more test asserts.

* install: fix error for nonex. dir path ending on /

The install command failed with a different error message than the
original GNU install tool. Checking for a trailing slash fixes this.
Only works on unix though.

* install: add windows support when checking for '/'

* install.rs: fix spelling

* install.rs: add more tests regarding omitting dir

This increases the CI test coverage and also checks for more corner
cases to ensure uu_install is compliant with GNU's original.

    export C=coreutils/target/debug/

    rm -rf dir1 no-dir2 dir3 file
    mkdir -p dir1 dir3
    touch file

    ${C}install dir1/file1 dir1/.. no-dir2
    ${C}install dir1/file1 dir1/.. dir3
    ${C}install dir1/.. dir3

* install: improve test_install_missing_arguments

Also check that install returns the correct error messages, when only a
target directory is given via -t and that is is not created (-D option).

* install: rework the checks for missing file args

This ensures correct (GNU install like) behavior. Tests from the last
commit will pass now.
2022-12-06 09:11:23 +01:00
..
test_arch.rs
test_base32.rs
test_base64.rs
test_basename.rs
test_basenc.rs
test_cat.rs
test_chcon.rs
test_chgrp.rs
test_chmod.rs
test_chown.rs
test_chroot.rs
test_cksum.rs
test_comm.rs
test_cp.rs
test_csplit.rs
test_cut.rs
test_date.rs
test_dd.rs
test_df.rs
test_dir.rs
test_dircolors.rs
test_dirname.rs
test_du.rs
test_echo.rs
test_env.rs
test_expand.rs
test_expr.rs
test_factor.rs
test_false.rs
test_fmt.rs
test_fold.rs
test_groups.rs
test_hashsum.rs
test_head.rs
test_hostid.rs
test_hostname.rs
test_id.rs
test_install.rs
test_join.rs
test_kill.rs
test_link.rs
test_ln.rs
test_logname.rs
test_ls.rs
test_mkdir.rs
test_mkfifo.rs
test_mknod.rs
test_mktemp.rs
test_more.rs
test_mv.rs
test_nice.rs
test_nl.rs
test_nohup.rs
test_nproc.rs
test_numfmt.rs
test_od.rs
test_paste.rs
test_pathchk.rs
test_pinky.rs
test_pr.rs
test_printenv.rs
test_printf.rs
test_ptx.rs
test_pwd.rs
test_readlink.rs
test_realpath.rs
test_relpath.rs
test_rm.rs
test_rmdir.rs
test_runcon.rs
test_seq.rs
test_shred.rs
test_shuf.rs
test_sleep.rs
test_sort.rs
test_split.rs
test_stat.rs
test_stdbuf.rs
test_stty.rs
test_sum.rs
test_sync.rs
test_tac.rs
test_tail.rs
test_tee.rs
test_test.rs
test_timeout.rs
test_touch.rs
test_tr.rs
test_true.rs
test_truncate.rs
test_tsort.rs
test_tty.rs
test_uname.rs
test_unexpand.rs
test_uniq.rs
test_unlink.rs
test_uptime.rs
test_users.rs
test_vdir.rs
test_wc.rs
test_who.rs
test_whoami.rs
test_yes.rs