coreutils/tests/common
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
..
macros.rs pwd: Properly resolve logical working directory (#2604) 2021-08-28 22:31:20 +02:00
mod.rs tests: move macros into separate module 2016-05-22 15:10:06 -04:00
util.rs realpath: Error when resolved symlink is absolute and ENOENT (#3037) 2022-03-03 23:06:15 +01:00