summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2019-10-14 09:24:28 -0600
committermo khan <mo.khan@gmail.com>2019-10-14 09:24:28 -0600
commit92d84c8aad4c99077695756a91e6edf2e6aea941 (patch)
treef8038c5ef0493c049acde874ddf2d511691a7ba0
parent2e2f6bcfa9c043007765e98f82baa4b461a7fe25 (diff)
Fix broken tests
-rwxr-xr-xbin/uid-zero6
-rw-r--r--test/example.bats6
2 files changed, 6 insertions, 6 deletions
diff --git a/bin/uid-zero b/bin/uid-zero
index 9b2640f..64adac7 100755
--- a/bin/uid-zero
+++ b/bin/uid-zero
@@ -2,8 +2,4 @@
FILE=${1:-'/etc/passwd'}
-if [[ "$OSTYPE" == "darwin"* ]]; then
- cat $FILE | cut -d: -f1,3 | grep ':0'
-else
- cat $FILE | grep -P '^\w+:[x]:\d+:0.*$'
-fi
+cat "$FILE" | cut -d: -f1,3 | grep ':0'
diff --git a/test/example.bats b/test/example.bats
index 5acd1ad..98b6212 100644
--- a/test/example.bats
+++ b/test/example.bats
@@ -16,5 +16,9 @@ load test_helper
@test "produces an error" {
run rm blah
- assert_failure $'rm: blah: No such file or directory'
+ if [[ "$OSTYPE" == "darwin"* ]]; then
+ assert_failure $'rm: blah: No such file or directory'
+ else
+ assert_failure $'rm: cannot remove \'blah\': No such file or directory'
+ fi
}