diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2022-03-13 13:30:52 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2022-03-13 13:30:52 -0400 |
commit | fa767895d4165dc9b0a8808f4760141067e0ea12 (patch) | |
tree | df0b877b6862ea397bdb3d5f544f382c6a5b1693 | |
parent | 2f0af35773d9f077a8950a3aeb99a78306aeb5cc (diff) | |
download | bfs-fa767895d4165dc9b0a8808f4760141067e0ea12.tar.xz |
tests: Use skip_if for more tests
-rwxr-xr-x | tests.sh | 26 |
1 files changed, 11 insertions, 15 deletions
@@ -1388,15 +1388,13 @@ function test_gid() { } function test_gid_plus() { - if [ "$(id -g)" -ne 0 ]; then - bfs_diff basic -gid +0 - fi + skip_if test "$(id -g)" -eq 0 + bfs_diff basic -gid +0 } function test_gid_plus_plus() { - if [ "$(id -g)" -ne 0 ]; then - bfs_diff basic -gid ++0 - fi + skip_if test "$(id -g)" -eq 0 + bfs_diff basic -gid ++0 } function test_gid_minus() { @@ -1412,15 +1410,13 @@ function test_uid() { } function test_uid_plus() { - if [ "$(id -u)" -ne 0 ]; then - bfs_diff basic -uid +0 - fi + skip_if test "$(id -u)" -eq 0 + bfs_diff basic -uid +0 } function test_uid_plus_plus() { - if [ "$(id -u)" -ne 0 ]; then - bfs_diff basic -uid ++0 - fi + skip_if test "$(id -u)" -eq 0 + bfs_diff basic -uid ++0 } function test_uid_minus() { @@ -1794,9 +1790,9 @@ function test_execdir() { } function test_execdir_plus() { - if [[ "$BFS" != *"-S dfs"* ]]; then - bfs_diff basic -execdir "$TESTS/sort-args.sh" '{}' + - fi + local tree=$(invoke_bfs -D tree 2>&1 -quit) + skip_if eval '[[ "$tree" == *"-S dfs"* ]]' + bfs_diff basic -execdir "$TESTS/sort-args.sh" '{}' + } function test_execdir_substring() { |