1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2026-01-15 01:31:08 +00:00
uutils-coreutils/tests
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
..
benches/factor all: change macros 2022-01-29 15:26:32 +01:00
by-util realpath: Error when resolved symlink is absolute and ENOENT (#3037) 2022-03-03 23:06:15 +01:00
common realpath: Error when resolved symlink is absolute and ENOENT (#3037) 2022-03-03 23:06:15 +01:00
fixtures split: add support for -e argument 2022-02-17 19:03:51 -05:00
test_util_name.rs tests: silence clippy warnings for unused_imports 2021-10-10 00:52:18 +02:00
tests.rs tests ~ use build.rs build list of test_UTIL module files 2020-06-02 12:17:30 -05:00