wildmatch test: use more standard shell style
[gitweb.git] / t / t3070-wildmatch.sh
index 163a14a1c2cb77b2a644a7342fd554940f7dd2e3..4d589d1f9a9f40075194076c135d0b6e0f50127c 100755 (executable)
@@ -5,39 +5,42 @@ test_description='wildmatch tests'
 . ./test-lib.sh
 
 match() {
-    if [ $1 = 1 ]; then
-       test_expect_success "wildmatch:     match '$3' '$4'" "
-           test-wildmatch wildmatch '$3' '$4'
-       "
-    else
-       test_expect_success "wildmatch:  no match '$3' '$4'" "
-           ! test-wildmatch wildmatch '$3' '$4'
-       "
-    fi
+       if test "$1" = 1
+       then
+               test_expect_success "wildmatch:     match '$3' '$4'" "
+                       test-wildmatch wildmatch '$3' '$4'
+               "
+       else
+               test_expect_success "wildmatch:  no match '$3' '$4'" "
+                       ! test-wildmatch wildmatch '$3' '$4'
+               "
+       fi
 }
 
 imatch() {
-    if [ $1 = 1 ]; then
-       test_expect_success "iwildmatch:    match '$2' '$3'" "
-           test-wildmatch iwildmatch '$2' '$3'
-       "
-    else
-       test_expect_success "iwildmatch: no match '$2' '$3'" "
-           ! test-wildmatch iwildmatch '$2' '$3'
-       "
-    fi
+       if test "$1" = 1
+       then
+               test_expect_success "iwildmatch:    match '$2' '$3'" "
+                       test-wildmatch iwildmatch '$2' '$3'
+               "
+       else
+               test_expect_success "iwildmatch: no match '$2' '$3'" "
+                       ! test-wildmatch iwildmatch '$2' '$3'
+               "
+       fi
 }
 
 pathmatch() {
-    if [ $1 = 1 ]; then
-       test_expect_success "pathmatch:     match '$2' '$3'" "
-           test-wildmatch pathmatch '$2' '$3'
-       "
-    else
-       test_expect_success "pathmatch:  no match '$2' '$3'" "
-           ! test-wildmatch pathmatch '$2' '$3'
-       "
-    fi
+       if test "$1" = 1
+       then
+               test_expect_success "pathmatch:     match '$2' '$3'" "
+                       test-wildmatch pathmatch '$2' '$3'
+               "
+       else
+               test_expect_success "pathmatch:  no match '$2' '$3'" "
+                       ! test-wildmatch pathmatch '$2' '$3'
+               "
+       fi
 }
 
 # Basic wildmat features