aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorCarlos Rica <jasampler@gmail.com>2007-07-10 23:53:45 +0200
committerJunio C Hamano <gitster@pobox.com>2007-07-11 15:02:05 -0700
commitdefd53142e0c3326c3677cc3d623a6aeef899518 (patch)
tree9f014c554a59fbf2563384f267315581f362ad65 /t
parent36d56de649aacdbf555d2c9743c514cc52368f2c (diff)
downloadgit-defd53142e0c3326c3677cc3d623a6aeef899518.tar.gz
git-defd53142e0c3326c3677cc3d623a6aeef899518.tar.xz
t0030: Remove repeated instructions and add missing &&
Moved some tests to another test_expect_success block. Many tests now reuse the same "expect" file. Also replacing many printf "" >expect with one >expect instruction. Added missing && which concatenated tests in some test_expect_success blocks. Signed-off-by: Carlos Rica <jasampler@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t0030-stripspace.sh37
1 files changed, 13 insertions, 24 deletions
diff --git a/t/t0030-stripspace.sh b/t/t0030-stripspace.sh
index fdc9fdce6..4a2980c83 100755
--- a/t/t0030-stripspace.sh
+++ b/t/t0030-stripspace.sh
@@ -85,39 +85,36 @@ test_expect_success \
'
test_expect_success \
- 'consecutive blank lines at the beginning should be removed' '
- printf "" > expect &&
+ 'only consecutive blank lines should be completely removed' '
+ > expect &&
+
printf "\n" | git stripspace >actual &&
git diff expect actual &&
- printf "" > expect &&
printf "\n\n\n" | git stripspace >actual &&
git diff expect actual &&
- printf "" > expect &&
printf "$sss\n$sss\n$sss\n" | git stripspace >actual &&
git diff expect actual &&
- printf "" > expect &&
printf "$sss$sss\n$sss\n\n" | git stripspace >actual &&
git diff expect actual &&
- printf "" > expect &&
printf "\n$sss\n$sss$sss\n" | git stripspace >actual &&
git diff expect actual &&
- printf "" > expect &&
printf "$sss$sss$sss$sss\n\n\n" | git stripspace >actual &&
git diff expect actual &&
- printf "" > expect &&
printf "\n$sss$sss$sss$sss\n\n" | git stripspace >actual &&
git diff expect actual &&
- printf "" > expect &&
printf "\n\n$sss$sss$sss$sss\n" | git stripspace >actual &&
- git diff expect actual &&
+ git diff expect actual
+'
+test_expect_success \
+ 'consecutive blank lines at the beginning should be removed' '
printf "$ttt\n" > expect &&
printf "\n$ttt\n" | git stripspace >actual &&
git diff expect actual &&
@@ -139,26 +136,22 @@ test_expect_success \
git diff expect actual &&
printf "$ttt\n" > expect &&
+
printf "$sss\n$sss\n$sss\n$ttt\n" | git stripspace >actual &&
git diff expect actual &&
- printf "$ttt\n" > expect &&
printf "\n$sss\n$sss$sss\n$ttt\n" | git stripspace >actual &&
git diff expect actual &&
- printf "$ttt\n" > expect &&
printf "$sss$sss\n$sss\n\n$ttt\n" | git stripspace >actual &&
git diff expect actual &&
- printf "$ttt\n" > expect &&
printf "$sss$sss$sss\n\n\n$ttt\n" | git stripspace >actual &&
git diff expect actual &&
- printf "$ttt\n" > expect &&
printf "\n$sss$sss$sss\n\n$ttt\n" | git stripspace >actual &&
git diff expect actual &&
- printf "$ttt\n" > expect &&
printf "\n\n$sss$sss$sss\n$ttt\n" | git stripspace >actual &&
git diff expect actual
'
@@ -186,26 +179,22 @@ test_expect_success \
git diff expect actual &&
printf "$ttt\n" > expect &&
+
printf "$ttt\n$sss\n$sss\n$sss\n" | git stripspace >actual &&
git diff expect actual &&
- printf "$ttt\n" > expect &&
printf "$ttt\n\n$sss\n$sss$sss\n" | git stripspace >actual &&
git diff expect actual &&
- printf "$ttt\n" > expect &&
printf "$ttt\n$sss$sss\n$sss\n\n" | git stripspace >actual &&
git diff expect actual &&
- printf "$ttt\n" > expect &&
printf "$ttt\n$sss$sss$sss\n\n\n" | git stripspace >actual &&
git diff expect actual &&
- printf "$ttt\n" > expect &&
printf "$ttt\n\n$sss$sss$sss\n\n" | git stripspace >actual &&
git diff expect actual &&
- printf "$ttt\n" > expect &&
printf "$ttt\n\n\n$sss$sss$sss\n" | git stripspace >actual &&
git diff expect actual
'
@@ -224,7 +213,7 @@ test_expect_success \
'text plus spaces without newline at end should end with newline' '
test `printf "$ttt$sss" | git stripspace | wc -l` -gt 0 &&
test `printf "$ttt$ttt$sss" | git stripspace | wc -l` -gt 0 &&
- test `printf "$ttt$ttt$ttt$sss" | git stripspace | wc -l` -gt 0
+ test `printf "$ttt$ttt$ttt$sss" | git stripspace | wc -l` -gt 0 &&
test `printf "$ttt$sss$sss" | git stripspace | wc -l` -gt 0 &&
test `printf "$ttt$ttt$sss$sss" | git stripspace | wc -l` -gt 0 &&
test `printf "$ttt$sss$sss$sss" | git stripspace | wc -l` -gt 0
@@ -340,13 +329,13 @@ test_expect_success \
printf "" >expect &&
printf "" | git stripspace >actual &&
- git diff expect actual
+ git diff expect actual &&
printf "$sss$sss" | git stripspace >actual &&
- git diff expect actual
+ git diff expect actual &&
printf "$sss$sss$sss" | git stripspace >actual &&
- git diff expect actual
+ git diff expect actual &&
printf "$sss$sss$sss$sss" | git stripspace >actual &&
git diff expect actual