Skip to content

Commit f38fee5

Browse files
authored
Make test-sdc script more portable (#520)
* Add a shebang because `-v` is a bash-ism not present in whatever my default shell is on macOS. * Remove `--quiet` from `cmp` - macOS's `cmp` doesn't support it.
1 parent 743e491 commit f38fee5

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

test-sdc.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/bin/bash
2+
13
# This test file will be automatically run when you submit a pull request
24
# You should not modify this file
35
# You can run this file using ./test-sdc.sh task-directory-name to check your output
@@ -18,7 +20,7 @@ if [[ "$1" == "individual-shell-tools" ]]; then
1820
for exercise in *.sh; do
1921
total=$(($total+1))
2022
./$exercise > ../../test.tmp
21-
cmp ../../test.tmp ../../expect/individual-shell-tools/$directory$exercise --quiet
23+
cmp ../../test.tmp ../../expect/individual-shell-tools/$directory$exercise
2224
if [ $? -eq 0 ]; then
2325
pass=$(($pass+1))
2426
else
@@ -54,7 +56,7 @@ elif [[ "$1" == "shell-pipelines" ]]; then
5456
for exercise in *.sh; do
5557
total=$(($total+1))
5658
./$exercise > ../../test.tmp
57-
cmp ../../test.tmp ../../expect/shell-pipelines/$directory$exercise --quiet
59+
cmp ../../test.tmp ../../expect/shell-pipelines/$directory$exercise
5860
if [ $? -eq 0 ]; then
5961
pass=$(($pass+1))
6062
else
@@ -83,7 +85,7 @@ elif [[ "$1" == "jq" ]]; then
8385
for exercise in *.sh; do
8486
total=$(($total+1))
8587
./$exercise > ../test.tmp
86-
cmp ../test.tmp ../expect/jq/$exercise --quiet
88+
cmp ../test.tmp ../expect/jq/$exercise
8789
if [ $? -eq 0 ]; then
8890
pass=$(($pass+1))
8991
else

0 commit comments

Comments
 (0)