diff options
| author | Enji Cooper <ngie@FreeBSD.org> | 2017-07-06 07:37:03 +0000 |
|---|---|---|
| committer | Enji Cooper <ngie@FreeBSD.org> | 2017-07-06 07:37:03 +0000 |
| commit | faef91fab6b57f374a29180ec9809ae3bc309e08 (patch) | |
| tree | c2511125eabeab0d358805f429ac7a12c195f56d | |
| parent | 5e8e7af348a6ba4d1774c8ae247f92e20ce9a6b9 (diff) | |
Notes
| -rwxr-xr-x | usr.bin/stat/tests/stat_test.sh | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/usr.bin/stat/tests/stat_test.sh b/usr.bin/stat/tests/stat_test.sh index 3a8032fd921f..55ec47107051 100755 --- a/usr.bin/stat/tests/stat_test.sh +++ b/usr.bin/stat/tests/stat_test.sh @@ -60,14 +60,23 @@ l_flag_body() paths="a b c d" + ls_out=ls.output + stat_out=stat.output + # NOTE: # - Even though stat -l claims to be equivalent to `ls -lT`, the # whitespace is a bit more liberal in the `ls -lT` output. # - `ls -ldT` is used to not recursively list the contents of # directories. for path in $paths; do - atf_check -o inline:"$(ls -ldT $path | sed -e 's, , ,g')\n" \ - stat -l $path + atf_check -o save:$ls_out ls -ldT $path + cat $ls_out + atf_check -o save:$stat_out stat -l $path + cat $stat_out + echo "Comparing normalized whitespace" + atf_check sed -i '' -E -e 's/[[:space:]]+/ /g' $ls_out + atf_check sed -i '' -E -e 's/[[:space:]]+/ /g' $stat_out + atf_check cmp $ls_out $stat_out done } |
