summaryrefslogtreecommitdiffstats
path: root/tests.sh
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2022-03-13 13:30:52 -0400
committerTavian Barnes <tavianator@tavianator.com>2022-03-13 13:30:52 -0400
commitfa767895d4165dc9b0a8808f4760141067e0ea12 (patch)
treedf0b877b6862ea397bdb3d5f544f382c6a5b1693 /tests.sh
parent2f0af35773d9f077a8950a3aeb99a78306aeb5cc (diff)
downloadbfs-fa767895d4165dc9b0a8808f4760141067e0ea12.tar.xz
tests: Use skip_if for more tests
Diffstat (limited to 'tests.sh')
-rwxr-xr-xtests.sh26
1 files changed, 11 insertions, 15 deletions
diff --git a/tests.sh b/tests.sh
index 995b7a6..d41f875 100755
--- a/tests.sh
+++ b/tests.sh
@@ -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() {