Joining7943
f610f33aa7
tests/util
: Don't trim output in CmdResult::stdout_matches
and stdout_does_not_match
(#4304 )
...
* tests/util: Fix documentation of UCommand::stderr_only and usage_error
* tests/util: Remove trimming from CmdResult::stdout_matches and stdout_does_not_match. Fix tests.
The tests are fixed to match the trailing newline instead of ignoring it.
2023-02-16 15:33:33 +01: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
14e3c5176c
realpath: require arguments again
2022-10-13 20:06:27 +02:00
Niyaz Nigmatullin
94860f8af6
tests/realpath: add trailing slash usage tests
2022-08-15 22:47:03 +03:00
Niyaz Nigmatullin
de65d4d649
Realpath relative options ( #3710 )
...
* realpath: introduce relative options, make correct exit codes, make pass
GNU test mist/realpath.sh
2022-07-12 08:29:20 +02:00
Niyaz Nigmatullin
9d285e953d
Realpath symlinks handling, solves issue #3669 ( #3703 )
2022-07-10 16:49:25 +02:00
Sylvestre Ledru
43a5b8c7d7
Merge pull request #3671 from niyaznigmatullin/fix_realpath_test
...
test_realpath: fixed test to be the one that was supposed to be
2022-07-06 09:42:15 +02:00
Niyaz Nigmatullin
4e936d2d0d
test_realpath: include issue id to ignored testcase
2022-06-30 11:52:17 +02:00
Niyaz Nigmatullin
9b2fa39760
test_realpath: get back to contains to pass in MacOs
2022-06-30 11:52:17 +02:00
Niyaz Nigmatullin
b3642b64c5
test_realpath: reformatted using rustfmt
2022-06-30 11:52:17 +02:00
Niyaz Nigmatullin
1ecc789dea
test_realpath: fixed test to be the one that was supposed to be and
...
added non-passing test
2022-06-30 11:52:17 +02:00
Daniel Hofstetter
113f0bd92b
realpath: add "--no-symlinks" alias
2022-06-30 11:51:24 +02:00
Hanif Ariffin
30a174e6e4
realpath: Error when resolved symlink is absolute and ENOENT ( #3037 )
...
* realpath: Match behavior where resolving symlinks with absolute path is an error if ENOENT
This PR changes `realpath` to match the behavior in GNU where,
```shell
hbina@akarin ~/Documents> mkdir dir1
hbina@akarin ~/Documents> mkdir dir2
hbina@akarin ~/Documents> touch dir2/bar
hbina@akarin ~/Documents> ln -s ../dir2/bar dir1/foo1
hbina@akarin ~/Documents> ln -s /dir2/bar dir1/foo2
hbina@akarin ~/Documents> ln -s ../dir2/baz dir1/foo3
hbina@akarin ~/Documents> realpath ./dir1/foo1 ./dir1/foo2 ./dir1/foo3
/home/hbina/Documents/dir2/bar
realpath: ./dir1/foo2: No such file or directory
/home/hbina/Documents/dir2/baz
```
Currently, our `realpath` will happily print the second one out,
```shell
hbina@akarin ~/Documents> ~/git/uutils/target/debug/coreutils realpath ./dir1/foo1 ./dir1/foo2 ./dir1/foo3
/home/hbina/Documents/dir2/bar
/dir2/bar
/home/hbina/Documents/dir2/baz
```
Closes https://github.com/uutils/coreutils/issues/3036
Signed-off-by: Hanif Ariffin <hanif.ariffin.4326@gmail.com>
2022-03-03 23:06:15 +01:00
James Robson
625c3f2330
Add -e/-m to realpath
2021-09-05 22:50:23 +02:00
Michael Debertol
ea41cc0ff6
uucore/fs: use the latest resolution that did not fail
...
When we ignore failures resolving symbolic links we should keep the
latest resolution that did not fail, not the original path.
2021-08-24 21:18:10 +02:00
James Robson
0e04f959c2
Add Physical mode to realpath
...
This adds the 'Physical Mode' and 'Logical Mode' switches to realpath, which control when symlinks are resolved.
2021-08-01 17:06:09 +01:00
Jan Scheer
cc30aead22
realpath: refactor tests for #1982
2021-04-05 23:55:02 +02:00
Sylvestre Ledru
992c113f09
Remove some old code
2021-01-22 09:40:38 +01:00
Sylvestre Ledru
18370f39b8
Remove some warnings
2021-01-22 09:40:38 +01:00
Sylvestre Ledru
b8d0467da8
test(realpath): improve the coverage
2021-01-19 20:56:27 +01:00
Roy Ivy III
de0375f909
tests ~ reorganize tests
2020-06-01 18:30:04 -05:00