t0030: Add tests with consecutive text lines and others with spaces added.
Previous tests only had paragraphs of one line. This commit adds some tests to check when many consecutive text lines are given. Also, it adds tests for checking that many lines between paragraphs are correctly reduced to one when there are tabs and spaces in those lines. Signed-off-by: Carlos Rica <jasampler@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Carlos Rica committed
Jul 10, 2007 at 23:59 UTC
b61a8a67478310eb3349d869119ce7a729090273
1 file changed
+51
t/t0030-stripspace.sh
+51
@@ -81,6 +81,30 @@ test_expect_success \
81
82
printf "$ttt\n\n$ttt$ttt$ttt\n" > expect &&
83
printf "$ttt\n\n\n\n\n$ttt$ttt$ttt\n" | git stripspace >actual &&
84
+ git diff expect actual &&
85
+
86
+ printf "$ttt\n\n$ttt\n" > expect &&
87
+ printf "$ttt\n\t\n \n\n \t\t\n$ttt\n" | git stripspace >actual &&
88
+ git diff expect actual &&
89
+
90
+ printf "$ttt$ttt\n\n$ttt\n" > expect &&
91
+ printf "$ttt$ttt\n\t\n \n\n \t\t\n$ttt\n" | git stripspace >actual &&
92
+ git diff expect actual &&
93
+
94
+ printf "$ttt$ttt$ttt\n\n$ttt\n" > expect &&
95
+ printf "$ttt$ttt$ttt\n\t\n \n\n \t\t\n$ttt\n" | git stripspace >actual &&
96
+ git diff expect actual &&
97
+
98
+ printf "$ttt\n\n$ttt\n" > expect &&
99
+ printf "$ttt\n\t\n \n\n \t\t\n$ttt\n" | git stripspace >actual &&
100
+ git diff expect actual &&
101
+
102
+ printf "$ttt\n\n$ttt$ttt\n" > expect &&
103
+ printf "$ttt\n\t\n \n\n \t\t\n$ttt$ttt\n" | git stripspace >actual &&
104
+ git diff expect actual &&
105
+
106
+ printf "$ttt\n\n$ttt$ttt$ttt\n" > expect &&
107
+ printf "$ttt\n\t\n \n\n \t\t\n$ttt$ttt$ttt\n" | git stripspace >actual &&
108
git diff expect actual
109
'
110
@@ -341,4 +365,31 @@ test_expect_success \
365
git diff expect actual
366
'
367
368
+test_expect_success \
369
+ 'consecutive text lines should be unchanged' '
370
+ printf "$ttt$ttt\n$ttt\n" >expect &&
371
+ printf "$ttt$ttt\n$ttt\n" | git stripspace >actual &&
372
+ git diff expect actual &&
373
+
374
+ printf "$ttt\n$ttt$ttt\n$ttt\n" >expect &&
375
+ printf "$ttt\n$ttt$ttt\n$ttt\n" | git stripspace >actual &&
376
+ git diff expect actual &&
377
+
378
+ printf "$ttt\n$ttt\n$ttt\n$ttt$ttt\n" >expect &&
379
+ printf "$ttt\n$ttt\n$ttt\n$ttt$ttt\n" | git stripspace >actual &&
380
+ git diff expect actual &&
381
+
382
+ printf "$ttt\n$ttt\n\n$ttt$ttt\n$ttt\n" >expect &&
383
+ printf "$ttt\n$ttt\n\n$ttt$ttt\n$ttt\n" | git stripspace >actual &&
384
+ git diff expect actual &&
385
+
386
+ printf "$ttt$ttt\n\n$ttt\n$ttt$ttt\n" >expect &&
387
+ printf "$ttt$ttt\n\n$ttt\n$ttt$ttt\n" | git stripspace >actual &&
388
+ git diff expect actual &&
389
+
390
+ printf "$ttt\n$ttt$ttt\n\n$ttt\n" >expect &&
391
+ printf "$ttt\n$ttt$ttt\n\n$ttt\n" | git stripspace >actual &&
392
+ git diff expect actual
393
+'
394
+
395
test_done