From b61a8a67478310eb3349d869119ce7a729090273 Mon Sep 17 00:00:00 2001 From: Carlos Rica Date: Tue, 10 Jul 2007 23:59:43 +0200 Subject: 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 Signed-off-by: Junio C Hamano --- t/t0030-stripspace.sh | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 't') diff --git a/t/t0030-stripspace.sh b/t/t0030-stripspace.sh index 4a2980c833..b1c900379b 100755 --- a/t/t0030-stripspace.sh +++ b/t/t0030-stripspace.sh @@ -81,6 +81,30 @@ test_expect_success \ printf "$ttt\n\n$ttt$ttt$ttt\n" > expect && printf "$ttt\n\n\n\n\n$ttt$ttt$ttt\n" | git stripspace >actual && + git diff expect actual && + + printf "$ttt\n\n$ttt\n" > expect && + printf "$ttt\n\t\n \n\n \t\t\n$ttt\n" | git stripspace >actual && + git diff expect actual && + + printf "$ttt$ttt\n\n$ttt\n" > expect && + printf "$ttt$ttt\n\t\n \n\n \t\t\n$ttt\n" | git stripspace >actual && + git diff expect actual && + + printf "$ttt$ttt$ttt\n\n$ttt\n" > expect && + printf "$ttt$ttt$ttt\n\t\n \n\n \t\t\n$ttt\n" | git stripspace >actual && + git diff expect actual && + + printf "$ttt\n\n$ttt\n" > expect && + printf "$ttt\n\t\n \n\n \t\t\n$ttt\n" | git stripspace >actual && + git diff expect actual && + + printf "$ttt\n\n$ttt$ttt\n" > expect && + printf "$ttt\n\t\n \n\n \t\t\n$ttt$ttt\n" | git stripspace >actual && + git diff expect actual && + + printf "$ttt\n\n$ttt$ttt$ttt\n" > expect && + printf "$ttt\n\t\n \n\n \t\t\n$ttt$ttt$ttt\n" | git stripspace >actual && git diff expect actual ' @@ -341,4 +365,31 @@ test_expect_success \ git diff expect actual ' +test_expect_success \ + 'consecutive text lines should be unchanged' ' + printf "$ttt$ttt\n$ttt\n" >expect && + printf "$ttt$ttt\n$ttt\n" | git stripspace >actual && + git diff expect actual && + + printf "$ttt\n$ttt$ttt\n$ttt\n" >expect && + printf "$ttt\n$ttt$ttt\n$ttt\n" | git stripspace >actual && + git diff expect actual && + + printf "$ttt\n$ttt\n$ttt\n$ttt$ttt\n" >expect && + printf "$ttt\n$ttt\n$ttt\n$ttt$ttt\n" | git stripspace >actual && + git diff expect actual && + + printf "$ttt\n$ttt\n\n$ttt$ttt\n$ttt\n" >expect && + printf "$ttt\n$ttt\n\n$ttt$ttt\n$ttt\n" | git stripspace >actual && + git diff expect actual && + + printf "$ttt$ttt\n\n$ttt\n$ttt$ttt\n" >expect && + printf "$ttt$ttt\n\n$ttt\n$ttt$ttt\n" | git stripspace >actual && + git diff expect actual && + + printf "$ttt\n$ttt$ttt\n\n$ttt\n" >expect && + printf "$ttt\n$ttt$ttt\n\n$ttt\n" | git stripspace >actual && + git diff expect actual +' + test_done -- cgit v1.2.1