Commit graph

11 commits

Author SHA1 Message Date
Tracy 126bbba17a
pwd: Fixes #4855 (#4937)
Based on testing with GNU's pwd, it seems like the -P flag should
take precedence over the use of the POSIXLY_CORRECT flag.

Co-authored-by: Terts Diepraam <terts.diepraam@gmail.com>
2023-06-04 16:03:01 +02:00
Sylvestre Ledru efa361dd7c Fix some trivial clippy warnings 2023-04-20 23:22:05 +02:00
Daniel Hofstetter 6988eb7ec6 tests: expand wildcard imports 2023-03-20 15:32:35 +01:00
Joining7943 fdf0f96a01 tests/util: Restructure UCommand to run in shell per default. Introduce constant TESTS_BINARY.
Summary of changes in tests/util:

* Introduce global constant TESTS_BINARY holding the path to `coreutils`
* Implement running an arbitrary command in a sh or cmd shell per default.
* Implement std::fmt::Display for UCommand.
* Change usages of UCommand::util_name from &Option<OsStr> to Option<OsStr>
* `UCommand::new_from_tmp`: Use OsStr directly instead of TempDir -> String -> OsStr
* Collect arguments in `UCommand::args` field
* Build environment variables in `UCommand` itself instead of `std::process::Command`
* Move building of std::process:Command from fields in UCommand to own method `build`
* Remove assertions of UCommand::has_run in arg, args and env.

Summary of changes in tests/by-util:

* Remove usages of UCommand::raw. Fix tests to use UCommand::to_string.
* test_test: Adjust test_invalid_utf8_integer_compare to use `UCommand::args`
* test_chmod: run_single_test
* test_pwd: symlinked_env
* test_cp:
    Fix the usage of &Option<OsStr> in `test_src_base_dot`
    Refactor test_src_base_dot to not use UCommand::new but ts.ucmd() instead
2023-02-17 17:39:33 +01:00
Sylvestre Ledru 34eabca299 pwd: support the env variable 'POSIXLY_CORRECT'
Should fix tests/misc/pwd-option.sh
2022-10-26 11:40:46 +02:00
Terts Diepraam 9177cb7b24 all: add tests for usage error exit code 2022-09-10 20:59:42 +02:00
Pyokyeong Son 9a76f3ba31 tests/mkdir: reduced tested permission combinations
tests/pwd: escapted directory paths
2022-03-31 15:50:52 +09:00
Jan Verbeek b4c95d49d8
pwd: Properly resolve logical working directory (#2604)
* pwd: Properly resolve logical working directory

* fixup! pwd: Properly resolve logical working directory

* fixup! pwd: Properly resolve logical working directory
2021-08-28 22:31:20 +02:00
Roy Ivy III 4e20dedf58 tests ~ refactor/polish spelling (comments, names, and exceptions) 2021-05-31 08:23:57 -05:00
Sylvestre Ledru 92d5d47434 refactor(pwd): move to clap + add a test 2020-11-03 23:12:16 +01:00
Roy Ivy III de0375f909 tests ~ reorganize tests 2020-06-01 18:30:04 -05:00
Renamed from tests/test_pwd.rs (Browse further)