regress: make test operands POSIX compliant Since the interpreter for the regress shell scripts are using /bin/sh this will usually imply some level of POSIX compliance (that isn't bash-specific, for instance). Some systems use dash as their sh shell and as such is stricter POSIX compliance. To help -portable, make the shell test checks use a single '=' for equality, rather than '=='.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
diff --git a/regress/cmdline/cherrypick.sh b/regress/cmdline/cherrypick.sh
index bb31a4f..ca1e787 100755
--- a/regress/cmdline/cherrypick.sh
+++ b/regress/cmdline/cherrypick.sh
@@ -588,7 +588,7 @@ EOF
(cd $testroot/wt && got commit -m 'commit cherrypick result' \
> /dev/null 2>$testroot/stderr)
ret="$?"
- if [ "$ret" == "0" ]; then
+ if [ "$ret" = "0" ]; then
echo "got commit succeeded unexpectedly" >&2
test_done "$testroot" "$ret"
return 1
diff --git a/regress/cmdline/diff.sh b/regress/cmdline/diff.sh
index 7f88ca1..66d5c86 100755
--- a/regress/cmdline/diff.sh
+++ b/regress/cmdline/diff.sh
@@ -278,7 +278,7 @@ test_diff_basic() {
# -P can only be used in a work tree
got diff -r $testroot/repo -P new master 2> $testroot/stderr
ret="$?"
- if [ "$ret" == "0" ]; then
+ if [ "$ret" = "0" ]; then
echo "diff succeeded unexpectedly" >&2
test_done "$testroot" "1"
return 1
@@ -1092,7 +1092,7 @@ test_diff_commits() {
(cd $testroot/repo && got diff -c $commit_id0 -c $commit_id1 -c foo \
2> $testroot/stderr)
ret="$?"
- if [ "$ret" == "0" ]; then
+ if [ "$ret" = "0" ]; then
echo "diff succeeded unexpectedly" >&2
test_done "$testroot" "1"
return 1
@@ -1110,7 +1110,7 @@ test_diff_commits() {
(cd $testroot/wt && got diff -c $commit_id0 -c $commit_id1 -P foo \
2> $testroot/stderr)
ret="$?"
- if [ "$ret" == "0" ]; then
+ if [ "$ret" = "0" ]; then
echo "diff succeeded unexpectedly" >&2
test_done "$testroot" "1"
return 1
@@ -1129,7 +1129,7 @@ test_diff_commits() {
(cd $testroot/wt && got diff -c $commit_id0 -c $commit_id1 -s foo \
2> $testroot/stderr)
ret="$?"
- if [ "$ret" == "0" ]; then
+ if [ "$ret" = "0" ]; then
echo "diff succeeded unexpectedly" >&2
test_done "$testroot" "1"
return 1
@@ -1148,7 +1148,7 @@ test_diff_commits() {
(cd $testroot/repo && got diff $commit_id0 $commit_id1 foo \
2> $testroot/stderr)
ret="$?"
- if [ "$ret" == "0" ]; then
+ if [ "$ret" = "0" ]; then
echo "diff succeeded unexpectedly" >&2
test_done "$testroot" "1"
return 1
@@ -1167,7 +1167,7 @@ test_diff_commits() {
(cd $testroot/wt && got diff $commit_id0 master foo \
2> $testroot/stderr)
ret="$?"
- if [ "$ret" == "0" ]; then
+ if [ "$ret" = "0" ]; then
echo "diff succeeded unexpectedly" >&2
test_done "$testroot" "1"
return 1