Commit graph

27 commits

Author SHA1 Message Date
Sylvestre Ledru
9d54ed02a8 ln -i: adjust the behavior to match the GNU change
Just like mv & cp

Matches the change upstream
7a69df88999bedd8e9fccf9f3dfa9ac6907fab66
2023-03-25 11:22:45 +01:00
Daniel Hofstetter
6988eb7ec6 tests: expand wildcard imports 2023-03-20 15:32:35 +01:00
Thayne McCombs
17f9507e17 Add tests for non-utf8 2023-02-21 22:58:39 -07:00
Daniel Hofstetter
f6b646e4e5 clippy: fix warnings introduced with Rust 1.67.0 2023-01-27 17:37:56 +01:00
Joining7943
1fadeb43b2 tests/util: Do not trim stderr in CmdResult::stderr_is. Add method stderr_trimmed_is.
Fix tests assert whitespace instead of trimming it. Disable some tests in `test_tr` because `tr`
produces too many newlines.
2023-01-22 14:56:19 +01:00
Terts Diepraam
7bb0e8f849 ln: use uucore::prompt_yes over custom function 2022-11-17 15:10:26 +01:00
Terts Diepraam
9177cb7b24 all: add tests for usage error exit code 2022-09-10 20:59:42 +02:00
Niyaz Nigmatullin
406d3931e9 tests/ln: fix tests according to new messages 2022-07-19 17:34:52 +03:00
Niyaz Nigmatullin
0ab0f2761f tests/ln: add test for same file 2022-07-18 08:17:37 +03:00
Sylvestre Ledru
06c2aea1b4 ln: Implement -L -P to make tests/ln/hard-to-sym.sh work 2022-06-01 23:03:50 +02:00
Justin Tracey
2a0d58d060 get android builds to compile and pass tests 2022-04-20 08:44:49 +02:00
Sylvestre Ledru
b3d87b088d ln: adjust the error messages 2022-04-01 09:25:35 +02:00
Sylvestre Ledru
676283ce93 ln: implement fixes for tests/ln/backup-1.sh
When doing
ln b b~
ln -f --b=simple a b

First, we create a backup of b
Then, we force the override of a => b but we make sure that the backup is
done.

So, we had a bug in the ordering of the actions.
we were first removing b. Therefore, losing the capability to do a backup of this.
2022-03-31 23:39:42 +02:00
Sylvestre Ledru
050b5b0c9b ln: make the tests/ln/hard-backup.sh test work
We haven't a great error message with hard link on the same file

+ Update the GNU error message to match ours
2022-03-30 20:00:11 +02:00
Terts Diepraam
184b65df20 uucore: allow backup suffix with hyphen value 2022-01-31 12:10:57 +01:00
Michael Debertol
3d3af5c8ca ln: don't return an empty path in relative_path 2021-06-18 11:53:29 +02:00
Michael Debertol
6c46d09397 ln: canonicalize the parent directory of dst, not dst
dst may or may not exist. In case it exists it might already be a symlink.
In neither case we should try to canonicalize dst, only its parent directory.

https://www.gnu.org/software/coreutils/manual/html_node/ln-invocation.html
> Relative symbolic links are generated based on their canonicalized
> **containing directory**, and canonicalized targets.
2021-06-03 19:10:22 +02:00
Michael Debertol
ed69d797b5 ln: reject --relative without --symbolic 2021-06-02 21:02:12 +02:00
Roy Ivy III
3f35e0a421 refactor ~ cargo make format 2021-05-31 08:23:58 -05:00
Roy Ivy III
4e20dedf58 tests ~ refactor/polish spelling (comments, names, and exceptions) 2021-05-31 08:23:57 -05:00
Yağız can Değirmenci
071899d24d tests: delete 'error:' prefix from the tests 2021-05-26 02:45:53 +03:00
Jan Scheer
646c6cacbc refactor tests (#1982) 2021-04-23 02:28:46 +02:00
Gilad Naaman
81d42aa2b3 Fix some tests to not use CmdResult fields 2021-04-10 23:30:50 +03:00
Sylvestre Ledru
4a23a1a218 feature(ln): Implement -n 2021-01-03 18:55:53 +01:00
Sylvestre Ledru
7f1d47b77a refactor(ln): move to clap 2021-01-02 22:35:21 +01:00
Sylvestre Ledru
f17a112781
feature(ln): implement -r (#1540)
* bump the minimal version of rustc to 1.32

* feature(ln): implement -r

* fix two issues

* Use cow

* rustfmt the change

* with cargo.lock 1.31

* try to unbreak windows
2020-06-18 00:54:18 -07:00
Roy Ivy III
de0375f909 tests ~ reorganize tests 2020-06-01 18:30:04 -05:00
Renamed from tests/test_ln.rs (Browse further)