Skip to content

Commit

Permalink
fs-own, tests: mode debugging of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
balupton committed Jan 8, 2025
1 parent 5ce4b8b commit 1c21e13
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
20 changes: 10 additions & 10 deletions commands/fs-own
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,37 @@ function fs_own_test() (
file="$(fs-temp --root="$root" --file='file' --touch)"

fs-structure -- "$root"

eval-tester --name='can own a file +quiet' \
-- fs-own --quiet -- "$file"

fs-structure -- "$root"

eval-tester --name='can own a directory +quiet' \
-- fs-own --quiet -- "$dir"

fs-structure -- "$root"

eval-tester --name='can own a file -quiet' --ignore-stdout \
-- fs-own --no-quiet -- "$file"

fs-structure -- "$root"

eval-tester --name='can own a directory -quiet' --ignore-stdout \
-- fs-own --no-quiet -- "$dir"

fs-structure -- "$root"

eval-tester --name='can own a file +verbose' --ignore-stdout --ignore-stderr \
-- fs-own --verbose -- "$file"

fs-structure -- "$root"

eval-tester --name='can own a directory +verbose' --ignore-stdout --ignore-stderr \
-- fs-own --verbose -- "$dir"

fs-structure -- "$root"

eval-tester --name='can own a directory +quiet +admin' --ignore-stderr \
-- fs-own --quiet --admin -- "$dir"

Expand All @@ -51,7 +51,7 @@ function fs_own_test() (

fs-structure -- "$root"

eval-tester --name='can own a directory +quiet +root' --ignore-stderr \
eval-tester --name='can own a directory +quiet +root' --ignore-stdout --ignore-stderr \
-- fs-own --verbose --root -- "$dir"

fs-structure -- "$root"
Expand Down Expand Up @@ -112,7 +112,7 @@ function fs_own() (
if provided, only the exact path will be used, not any child paths.
QUIRKS:
If [--permissions=...], [--directory-permissions=...], [--file-permissions=...] are all omitted, then the directory permissions will be set to [755] and the file permissions set to [644].
If [--permissions=...], [--directory-permissions=...], [--file-permissions=...] are all omitted, then the permissions will be set to [a-xrw,ug+Xrw].
EOF
if [[ $# -ne 0 ]]; then
echo-error "$@"
Expand Down Expand Up @@ -299,7 +299,7 @@ function fs_own() (
fi
if [[ $option_verbose == 'yes' ]]; then
if is-mac; then
echo-style --dim='Verbose permission changes is not provided by this Operating System.' >/dev/stderr
ch_args+=('-v')
else
ch_args+=('--verbose')
fi
Expand Down
4 changes: 3 additions & 1 deletion sources/tests.bash
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function fs_tests__prep {
"$root/targets/unwritable-empty-file" \
"$root/targets/unwritable-filled-dir" \
"$root/targets/unwritable-filled-file"
sudo-helper -- chown '0:0' \
sudo-helper -- chown -n '0:0' \
"$root/targets/unaccessible-empty-dir" \
"$root/targets/unaccessible-empty-file" \
"$root/targets/unaccessible-filled-dir" \
Expand All @@ -128,6 +128,8 @@ function fs_tests__prep {
"$root/targets/unaccessible-filled-dir" \
"$root/targets/unaccessible-filled-file"

fs-structure -- "$root"

__print_lines "$root"
}

Expand Down

0 comments on commit 1c21e13

Please sign in to comment.