2007-06-25 21:24:21 +02:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Copyright (c) 2007 Carlos Rica
|
|
|
|
#
|
|
|
|
|
2007-07-03 07:52:14 +02:00
|
|
|
test_description='git stripspace'
|
2007-06-25 21:24:21 +02:00
|
|
|
|
|
|
|
. ./test-lib.sh
|
|
|
|
|
|
|
|
t40='A quick brown fox jumps over the lazy do'
|
|
|
|
s40=' '
|
|
|
|
sss="$s40$s40$s40$s40$s40$s40$s40$s40$s40$s40" # 400
|
|
|
|
ttt="$t40$t40$t40$t40$t40$t40$t40$t40$t40$t40" # 400
|
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'long lines without spaces should be unchanged' '
|
|
|
|
echo "$ttt" >expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
git stripspace <expect >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
|
|
|
echo "$ttt$ttt" >expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
git stripspace <expect >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
|
|
|
echo "$ttt$ttt$ttt" >expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
git stripspace <expect >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
|
|
|
echo "$ttt$ttt$ttt$ttt" >expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
git stripspace <expect >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual
|
2007-06-25 21:24:21 +02:00
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'lines with spaces at the beginning should be unchanged' '
|
|
|
|
echo "$sss$ttt" >expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
git stripspace <expect >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
|
|
|
echo "$sss$sss$ttt" >expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
git stripspace <expect >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
|
|
|
echo "$sss$sss$sss$ttt" >expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
git stripspace <expect >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual
|
2007-06-25 21:24:21 +02:00
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'lines with intermediate spaces should be unchanged' '
|
|
|
|
echo "$ttt$sss$ttt" >expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
git stripspace <expect >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
|
|
|
echo "$ttt$sss$sss$ttt" >expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
git stripspace <expect >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual
|
2007-06-25 21:24:21 +02:00
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'consecutive blank lines should be unified' '
|
|
|
|
printf "$ttt\n\n$ttt\n" > expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "$ttt\n\n\n\n\n$ttt\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
|
|
|
printf "$ttt$ttt\n\n$ttt\n" > expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "$ttt$ttt\n\n\n\n\n$ttt\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
|
|
|
printf "$ttt$ttt$ttt\n\n$ttt\n" > expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "$ttt$ttt$ttt\n\n\n\n\n$ttt\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
|
|
|
printf "$ttt\n\n$ttt\n" > expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "$ttt\n\n\n\n\n$ttt\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
|
|
|
printf "$ttt\n\n$ttt$ttt\n" > expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "$ttt\n\n\n\n\n$ttt$ttt\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
|
|
|
printf "$ttt\n\n$ttt$ttt$ttt\n" > expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "$ttt\n\n\n\n\n$ttt$ttt$ttt\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-07-10 23:59:43 +02:00
|
|
|
|
|
|
|
printf "$ttt\n\n$ttt\n" > expect &&
|
|
|
|
printf "$ttt\n\t\n \n\n \t\t\n$ttt\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-07-10 23:59:43 +02:00
|
|
|
|
|
|
|
printf "$ttt$ttt\n\n$ttt\n" > expect &&
|
|
|
|
printf "$ttt$ttt\n\t\n \n\n \t\t\n$ttt\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-07-10 23:59:43 +02:00
|
|
|
|
|
|
|
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 &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-07-10 23:59:43 +02:00
|
|
|
|
|
|
|
printf "$ttt\n\n$ttt\n" > expect &&
|
|
|
|
printf "$ttt\n\t\n \n\n \t\t\n$ttt\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-07-10 23:59:43 +02:00
|
|
|
|
|
|
|
printf "$ttt\n\n$ttt$ttt\n" > expect &&
|
|
|
|
printf "$ttt\n\t\n \n\n \t\t\n$ttt$ttt\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-07-10 23:59:43 +02:00
|
|
|
|
|
|
|
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 &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual
|
2007-06-25 21:24:21 +02:00
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success \
|
2007-07-10 23:53:45 +02:00
|
|
|
'only consecutive blank lines should be completely removed' '
|
|
|
|
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "\n" | git stripspace >actual &&
|
2018-07-27 19:48:11 +02:00
|
|
|
test_must_be_empty actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "\n\n\n" | git stripspace >actual &&
|
2018-07-27 19:48:11 +02:00
|
|
|
test_must_be_empty actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "$sss\n$sss\n$sss\n" | git stripspace >actual &&
|
2018-07-27 19:48:11 +02:00
|
|
|
test_must_be_empty actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "$sss$sss\n$sss\n\n" | git stripspace >actual &&
|
2018-07-27 19:48:11 +02:00
|
|
|
test_must_be_empty actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "\n$sss\n$sss$sss\n" | git stripspace >actual &&
|
2018-07-27 19:48:11 +02:00
|
|
|
test_must_be_empty actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "$sss$sss$sss$sss\n\n\n" | git stripspace >actual &&
|
2018-07-27 19:48:11 +02:00
|
|
|
test_must_be_empty actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "\n$sss$sss$sss$sss\n\n" | git stripspace >actual &&
|
2018-07-27 19:48:11 +02:00
|
|
|
test_must_be_empty actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "\n\n$sss$sss$sss$sss\n" | git stripspace >actual &&
|
2018-07-27 19:48:11 +02:00
|
|
|
test_must_be_empty actual
|
2007-07-10 23:53:45 +02:00
|
|
|
'
|
2007-06-25 21:24:21 +02:00
|
|
|
|
2007-07-10 23:53:45 +02:00
|
|
|
test_expect_success \
|
|
|
|
'consecutive blank lines at the beginning should be removed' '
|
2007-06-25 21:24:21 +02:00
|
|
|
printf "$ttt\n" > expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "\n$ttt\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
|
|
|
printf "$ttt\n" > expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "\n\n\n$ttt\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
|
|
|
printf "$ttt$ttt\n" > expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "\n\n\n$ttt$ttt\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
|
|
|
printf "$ttt$ttt$ttt\n" > expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "\n\n\n$ttt$ttt$ttt\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
|
|
|
printf "$ttt$ttt$ttt$ttt\n" > expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "\n\n\n$ttt$ttt$ttt$ttt\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
|
|
|
printf "$ttt\n" > expect &&
|
2007-07-10 23:53:45 +02:00
|
|
|
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "$sss\n$sss\n$sss\n$ttt\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "\n$sss\n$sss$sss\n$ttt\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "$sss$sss\n$sss\n\n$ttt\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "$sss$sss$sss\n\n\n$ttt\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "\n$sss$sss$sss\n\n$ttt\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "\n\n$sss$sss$sss\n$ttt\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual
|
2007-06-25 21:24:21 +02:00
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'consecutive blank lines at the end should be removed' '
|
|
|
|
printf "$ttt\n" > expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "$ttt\n\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
|
|
|
printf "$ttt\n" > expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "$ttt\n\n\n\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
|
|
|
printf "$ttt$ttt\n" > expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "$ttt$ttt\n\n\n\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
|
|
|
printf "$ttt$ttt$ttt\n" > expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "$ttt$ttt$ttt\n\n\n\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
|
|
|
printf "$ttt$ttt$ttt$ttt\n" > expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "$ttt$ttt$ttt$ttt\n\n\n\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
|
|
|
printf "$ttt\n" > expect &&
|
2007-07-10 23:53:45 +02:00
|
|
|
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "$ttt\n$sss\n$sss\n$sss\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "$ttt\n\n$sss\n$sss$sss\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "$ttt\n$sss$sss\n$sss\n\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "$ttt\n$sss$sss$sss\n\n\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "$ttt\n\n$sss$sss$sss\n\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "$ttt\n\n\n$sss$sss$sss\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual
|
2007-06-25 21:24:21 +02:00
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'text without newline at end should end with newline' '
|
2014-04-28 14:57:29 +02:00
|
|
|
test $(printf "$ttt" | git stripspace | wc -l) -gt 0 &&
|
|
|
|
test $(printf "$ttt$ttt" | git stripspace | wc -l) -gt 0 &&
|
|
|
|
test $(printf "$ttt$ttt$ttt" | git stripspace | wc -l) -gt 0 &&
|
|
|
|
test $(printf "$ttt$ttt$ttt$ttt" | git stripspace | wc -l) -gt 0
|
2007-06-25 21:24:21 +02:00
|
|
|
'
|
|
|
|
|
|
|
|
# text plus spaces at the end:
|
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'text plus spaces without newline at end should end with newline' '
|
2014-04-28 14:57:29 +02:00
|
|
|
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$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
|
2007-06-25 21:24:21 +02:00
|
|
|
'
|
|
|
|
|
2008-02-01 10:50:53 +01:00
|
|
|
test_expect_success \
|
2007-06-25 21:24:21 +02:00
|
|
|
'text plus spaces without newline at end should not show spaces' '
|
2008-03-12 22:32:17 +01:00
|
|
|
! (printf "$ttt$sss" | git stripspace | grep " " >/dev/null) &&
|
|
|
|
! (printf "$ttt$ttt$sss" | git stripspace | grep " " >/dev/null) &&
|
|
|
|
! (printf "$ttt$ttt$ttt$sss" | git stripspace | grep " " >/dev/null) &&
|
|
|
|
! (printf "$ttt$sss$sss" | git stripspace | grep " " >/dev/null) &&
|
|
|
|
! (printf "$ttt$ttt$sss$sss" | git stripspace | grep " " >/dev/null) &&
|
|
|
|
! (printf "$ttt$sss$sss$sss" | git stripspace | grep " " >/dev/null)
|
2007-06-25 21:24:21 +02:00
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'text plus spaces without newline should show the correct lines' '
|
|
|
|
printf "$ttt\n" >expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "$ttt$sss" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
|
|
|
printf "$ttt\n" >expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "$ttt$sss$sss" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
|
|
|
printf "$ttt\n" >expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "$ttt$sss$sss$sss" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
|
|
|
printf "$ttt$ttt\n" >expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "$ttt$ttt$sss" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
|
|
|
printf "$ttt$ttt\n" >expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "$ttt$ttt$sss$sss" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
|
|
|
printf "$ttt$ttt$ttt\n" >expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "$ttt$ttt$ttt$sss" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual
|
2007-06-25 21:24:21 +02:00
|
|
|
'
|
|
|
|
|
2008-02-01 10:50:53 +01:00
|
|
|
test_expect_success \
|
2007-06-25 21:24:21 +02:00
|
|
|
'text plus spaces at end should not show spaces' '
|
2008-03-12 22:32:17 +01:00
|
|
|
! (echo "$ttt$sss" | git stripspace | grep " " >/dev/null) &&
|
|
|
|
! (echo "$ttt$ttt$sss" | git stripspace | grep " " >/dev/null) &&
|
|
|
|
! (echo "$ttt$ttt$ttt$sss" | git stripspace | grep " " >/dev/null) &&
|
|
|
|
! (echo "$ttt$sss$sss" | git stripspace | grep " " >/dev/null) &&
|
|
|
|
! (echo "$ttt$ttt$sss$sss" | git stripspace | grep " " >/dev/null) &&
|
|
|
|
! (echo "$ttt$sss$sss$sss" | git stripspace | grep " " >/dev/null)
|
2007-06-25 21:24:21 +02:00
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'text plus spaces at end should be cleaned and newline must remain' '
|
|
|
|
echo "$ttt" >expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
echo "$ttt$sss" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
|
|
|
echo "$ttt" >expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
echo "$ttt$sss$sss" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
|
|
|
echo "$ttt" >expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
echo "$ttt$sss$sss$sss" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
|
|
|
echo "$ttt$ttt" >expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
echo "$ttt$ttt$sss" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
|
|
|
echo "$ttt$ttt" >expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
echo "$ttt$ttt$sss$sss" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
|
|
|
echo "$ttt$ttt$ttt" >expect &&
|
2007-07-03 07:52:14 +02:00
|
|
|
echo "$ttt$ttt$ttt$sss" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual
|
2007-06-25 21:24:21 +02:00
|
|
|
'
|
|
|
|
|
|
|
|
# spaces only:
|
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'spaces with newline at end should be replaced with empty string' '
|
2007-07-03 07:52:14 +02:00
|
|
|
echo | git stripspace >actual &&
|
tests: use 'test_must_be_empty' instead of 'test_cmp <empty> <out>'
Using 'test_must_be_empty' is shorter and more idiomatic than
>empty &&
test_cmp empty out
as it saves the creation of an empty file. Furthermore, sometimes the
expected empty file doesn't have such a descriptive name like 'empty',
and its creation is far away from the place where it's finally used
for comparison (e.g. in 't7600-merge.sh', where two expected empty
files are created in the 'setup' test, but are used only about 500
lines later).
These cases were found by instrumenting 'test_cmp' to error out the
test script when it's used to compare empty files, and then converted
manually.
Note that even after this patch there still remain a lot of cases
where we use 'test_cmp' to check empty files:
- Sometimes the expected output is not hard-coded in the test, but
'test_cmp' is used to ensure that two similar git commands produce
the same output, and that output happens to be empty, e.g. the
test 'submodule update --merge - ignores --merge for new
submodules' in 't7406-submodule-update.sh'.
- Repetitive common tasks, including preparing the expected results
and running 'test_cmp', are often extracted into a helper
function, and some of this helper's callsites expect no output.
- For the same reason as above, the whole 'test_expect_success'
block is within a helper function, e.g. in 't3070-wildmatch.sh'.
- Or 'test_cmp' is invoked in a loop, e.g. the test 'cvs update
(-p)' in 't9400-git-cvsserver-server.sh'.
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-19 23:57:25 +02:00
|
|
|
test_must_be_empty actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
2007-07-03 07:52:14 +02:00
|
|
|
echo "$sss" | git stripspace >actual &&
|
tests: use 'test_must_be_empty' instead of 'test_cmp <empty> <out>'
Using 'test_must_be_empty' is shorter and more idiomatic than
>empty &&
test_cmp empty out
as it saves the creation of an empty file. Furthermore, sometimes the
expected empty file doesn't have such a descriptive name like 'empty',
and its creation is far away from the place where it's finally used
for comparison (e.g. in 't7600-merge.sh', where two expected empty
files are created in the 'setup' test, but are used only about 500
lines later).
These cases were found by instrumenting 'test_cmp' to error out the
test script when it's used to compare empty files, and then converted
manually.
Note that even after this patch there still remain a lot of cases
where we use 'test_cmp' to check empty files:
- Sometimes the expected output is not hard-coded in the test, but
'test_cmp' is used to ensure that two similar git commands produce
the same output, and that output happens to be empty, e.g. the
test 'submodule update --merge - ignores --merge for new
submodules' in 't7406-submodule-update.sh'.
- Repetitive common tasks, including preparing the expected results
and running 'test_cmp', are often extracted into a helper
function, and some of this helper's callsites expect no output.
- For the same reason as above, the whole 'test_expect_success'
block is within a helper function, e.g. in 't3070-wildmatch.sh'.
- Or 'test_cmp' is invoked in a loop, e.g. the test 'cvs update
(-p)' in 't9400-git-cvsserver-server.sh'.
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-19 23:57:25 +02:00
|
|
|
test_must_be_empty actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
2007-07-03 07:52:14 +02:00
|
|
|
echo "$sss$sss" | git stripspace >actual &&
|
tests: use 'test_must_be_empty' instead of 'test_cmp <empty> <out>'
Using 'test_must_be_empty' is shorter and more idiomatic than
>empty &&
test_cmp empty out
as it saves the creation of an empty file. Furthermore, sometimes the
expected empty file doesn't have such a descriptive name like 'empty',
and its creation is far away from the place where it's finally used
for comparison (e.g. in 't7600-merge.sh', where two expected empty
files are created in the 'setup' test, but are used only about 500
lines later).
These cases were found by instrumenting 'test_cmp' to error out the
test script when it's used to compare empty files, and then converted
manually.
Note that even after this patch there still remain a lot of cases
where we use 'test_cmp' to check empty files:
- Sometimes the expected output is not hard-coded in the test, but
'test_cmp' is used to ensure that two similar git commands produce
the same output, and that output happens to be empty, e.g. the
test 'submodule update --merge - ignores --merge for new
submodules' in 't7406-submodule-update.sh'.
- Repetitive common tasks, including preparing the expected results
and running 'test_cmp', are often extracted into a helper
function, and some of this helper's callsites expect no output.
- For the same reason as above, the whole 'test_expect_success'
block is within a helper function, e.g. in 't3070-wildmatch.sh'.
- Or 'test_cmp' is invoked in a loop, e.g. the test 'cvs update
(-p)' in 't9400-git-cvsserver-server.sh'.
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-19 23:57:25 +02:00
|
|
|
test_must_be_empty actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
2007-07-03 07:52:14 +02:00
|
|
|
echo "$sss$sss$sss" | git stripspace >actual &&
|
tests: use 'test_must_be_empty' instead of 'test_cmp <empty> <out>'
Using 'test_must_be_empty' is shorter and more idiomatic than
>empty &&
test_cmp empty out
as it saves the creation of an empty file. Furthermore, sometimes the
expected empty file doesn't have such a descriptive name like 'empty',
and its creation is far away from the place where it's finally used
for comparison (e.g. in 't7600-merge.sh', where two expected empty
files are created in the 'setup' test, but are used only about 500
lines later).
These cases were found by instrumenting 'test_cmp' to error out the
test script when it's used to compare empty files, and then converted
manually.
Note that even after this patch there still remain a lot of cases
where we use 'test_cmp' to check empty files:
- Sometimes the expected output is not hard-coded in the test, but
'test_cmp' is used to ensure that two similar git commands produce
the same output, and that output happens to be empty, e.g. the
test 'submodule update --merge - ignores --merge for new
submodules' in 't7406-submodule-update.sh'.
- Repetitive common tasks, including preparing the expected results
and running 'test_cmp', are often extracted into a helper
function, and some of this helper's callsites expect no output.
- For the same reason as above, the whole 'test_expect_success'
block is within a helper function, e.g. in 't3070-wildmatch.sh'.
- Or 'test_cmp' is invoked in a loop, e.g. the test 'cvs update
(-p)' in 't9400-git-cvsserver-server.sh'.
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-19 23:57:25 +02:00
|
|
|
test_must_be_empty actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
2007-07-03 07:52:14 +02:00
|
|
|
echo "$sss$sss$sss$sss" | git stripspace >actual &&
|
tests: use 'test_must_be_empty' instead of 'test_cmp <empty> <out>'
Using 'test_must_be_empty' is shorter and more idiomatic than
>empty &&
test_cmp empty out
as it saves the creation of an empty file. Furthermore, sometimes the
expected empty file doesn't have such a descriptive name like 'empty',
and its creation is far away from the place where it's finally used
for comparison (e.g. in 't7600-merge.sh', where two expected empty
files are created in the 'setup' test, but are used only about 500
lines later).
These cases were found by instrumenting 'test_cmp' to error out the
test script when it's used to compare empty files, and then converted
manually.
Note that even after this patch there still remain a lot of cases
where we use 'test_cmp' to check empty files:
- Sometimes the expected output is not hard-coded in the test, but
'test_cmp' is used to ensure that two similar git commands produce
the same output, and that output happens to be empty, e.g. the
test 'submodule update --merge - ignores --merge for new
submodules' in 't7406-submodule-update.sh'.
- Repetitive common tasks, including preparing the expected results
and running 'test_cmp', are often extracted into a helper
function, and some of this helper's callsites expect no output.
- For the same reason as above, the whole 'test_expect_success'
block is within a helper function, e.g. in 't3070-wildmatch.sh'.
- Or 'test_cmp' is invoked in a loop, e.g. the test 'cvs update
(-p)' in 't9400-git-cvsserver-server.sh'.
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-19 23:57:25 +02:00
|
|
|
test_must_be_empty actual
|
2007-06-25 21:24:21 +02:00
|
|
|
'
|
|
|
|
|
2008-02-01 10:50:53 +01:00
|
|
|
test_expect_success \
|
2007-06-25 21:24:21 +02:00
|
|
|
'spaces without newline at end should not show spaces' '
|
2008-03-12 22:32:17 +01:00
|
|
|
! (printf "" | git stripspace | grep " " >/dev/null) &&
|
|
|
|
! (printf "$sss" | git stripspace | grep " " >/dev/null) &&
|
|
|
|
! (printf "$sss$sss" | git stripspace | grep " " >/dev/null) &&
|
|
|
|
! (printf "$sss$sss$sss" | git stripspace | grep " " >/dev/null) &&
|
|
|
|
! (printf "$sss$sss$sss$sss" | git stripspace | grep " " >/dev/null)
|
2007-06-25 21:24:21 +02:00
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'spaces without newline at end should be replaced with empty string' '
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "" | git stripspace >actual &&
|
tests: use 'test_must_be_empty' instead of 'test_cmp <empty> <out>'
Using 'test_must_be_empty' is shorter and more idiomatic than
>empty &&
test_cmp empty out
as it saves the creation of an empty file. Furthermore, sometimes the
expected empty file doesn't have such a descriptive name like 'empty',
and its creation is far away from the place where it's finally used
for comparison (e.g. in 't7600-merge.sh', where two expected empty
files are created in the 'setup' test, but are used only about 500
lines later).
These cases were found by instrumenting 'test_cmp' to error out the
test script when it's used to compare empty files, and then converted
manually.
Note that even after this patch there still remain a lot of cases
where we use 'test_cmp' to check empty files:
- Sometimes the expected output is not hard-coded in the test, but
'test_cmp' is used to ensure that two similar git commands produce
the same output, and that output happens to be empty, e.g. the
test 'submodule update --merge - ignores --merge for new
submodules' in 't7406-submodule-update.sh'.
- Repetitive common tasks, including preparing the expected results
and running 'test_cmp', are often extracted into a helper
function, and some of this helper's callsites expect no output.
- For the same reason as above, the whole 'test_expect_success'
block is within a helper function, e.g. in 't3070-wildmatch.sh'.
- Or 'test_cmp' is invoked in a loop, e.g. the test 'cvs update
(-p)' in 't9400-git-cvsserver-server.sh'.
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-19 23:57:25 +02:00
|
|
|
test_must_be_empty actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "$sss$sss" | git stripspace >actual &&
|
tests: use 'test_must_be_empty' instead of 'test_cmp <empty> <out>'
Using 'test_must_be_empty' is shorter and more idiomatic than
>empty &&
test_cmp empty out
as it saves the creation of an empty file. Furthermore, sometimes the
expected empty file doesn't have such a descriptive name like 'empty',
and its creation is far away from the place where it's finally used
for comparison (e.g. in 't7600-merge.sh', where two expected empty
files are created in the 'setup' test, but are used only about 500
lines later).
These cases were found by instrumenting 'test_cmp' to error out the
test script when it's used to compare empty files, and then converted
manually.
Note that even after this patch there still remain a lot of cases
where we use 'test_cmp' to check empty files:
- Sometimes the expected output is not hard-coded in the test, but
'test_cmp' is used to ensure that two similar git commands produce
the same output, and that output happens to be empty, e.g. the
test 'submodule update --merge - ignores --merge for new
submodules' in 't7406-submodule-update.sh'.
- Repetitive common tasks, including preparing the expected results
and running 'test_cmp', are often extracted into a helper
function, and some of this helper's callsites expect no output.
- For the same reason as above, the whole 'test_expect_success'
block is within a helper function, e.g. in 't3070-wildmatch.sh'.
- Or 'test_cmp' is invoked in a loop, e.g. the test 'cvs update
(-p)' in 't9400-git-cvsserver-server.sh'.
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-19 23:57:25 +02:00
|
|
|
test_must_be_empty actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "$sss$sss$sss" | git stripspace >actual &&
|
tests: use 'test_must_be_empty' instead of 'test_cmp <empty> <out>'
Using 'test_must_be_empty' is shorter and more idiomatic than
>empty &&
test_cmp empty out
as it saves the creation of an empty file. Furthermore, sometimes the
expected empty file doesn't have such a descriptive name like 'empty',
and its creation is far away from the place where it's finally used
for comparison (e.g. in 't7600-merge.sh', where two expected empty
files are created in the 'setup' test, but are used only about 500
lines later).
These cases were found by instrumenting 'test_cmp' to error out the
test script when it's used to compare empty files, and then converted
manually.
Note that even after this patch there still remain a lot of cases
where we use 'test_cmp' to check empty files:
- Sometimes the expected output is not hard-coded in the test, but
'test_cmp' is used to ensure that two similar git commands produce
the same output, and that output happens to be empty, e.g. the
test 'submodule update --merge - ignores --merge for new
submodules' in 't7406-submodule-update.sh'.
- Repetitive common tasks, including preparing the expected results
and running 'test_cmp', are often extracted into a helper
function, and some of this helper's callsites expect no output.
- For the same reason as above, the whole 'test_expect_success'
block is within a helper function, e.g. in 't3070-wildmatch.sh'.
- Or 'test_cmp' is invoked in a loop, e.g. the test 'cvs update
(-p)' in 't9400-git-cvsserver-server.sh'.
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-19 23:57:25 +02:00
|
|
|
test_must_be_empty actual &&
|
2007-06-25 21:24:21 +02:00
|
|
|
|
2007-07-03 07:52:14 +02:00
|
|
|
printf "$sss$sss$sss$sss" | git stripspace >actual &&
|
tests: use 'test_must_be_empty' instead of 'test_cmp <empty> <out>'
Using 'test_must_be_empty' is shorter and more idiomatic than
>empty &&
test_cmp empty out
as it saves the creation of an empty file. Furthermore, sometimes the
expected empty file doesn't have such a descriptive name like 'empty',
and its creation is far away from the place where it's finally used
for comparison (e.g. in 't7600-merge.sh', where two expected empty
files are created in the 'setup' test, but are used only about 500
lines later).
These cases were found by instrumenting 'test_cmp' to error out the
test script when it's used to compare empty files, and then converted
manually.
Note that even after this patch there still remain a lot of cases
where we use 'test_cmp' to check empty files:
- Sometimes the expected output is not hard-coded in the test, but
'test_cmp' is used to ensure that two similar git commands produce
the same output, and that output happens to be empty, e.g. the
test 'submodule update --merge - ignores --merge for new
submodules' in 't7406-submodule-update.sh'.
- Repetitive common tasks, including preparing the expected results
and running 'test_cmp', are often extracted into a helper
function, and some of this helper's callsites expect no output.
- For the same reason as above, the whole 'test_expect_success'
block is within a helper function, e.g. in 't3070-wildmatch.sh'.
- Or 'test_cmp' is invoked in a loop, e.g. the test 'cvs update
(-p)' in 't9400-git-cvsserver-server.sh'.
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-19 23:57:25 +02:00
|
|
|
test_must_be_empty actual
|
2007-06-25 21:24:21 +02:00
|
|
|
'
|
|
|
|
|
2007-07-10 23:59:43 +02:00
|
|
|
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 &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-07-10 23:59:43 +02:00
|
|
|
|
|
|
|
printf "$ttt\n$ttt$ttt\n$ttt\n" >expect &&
|
|
|
|
printf "$ttt\n$ttt$ttt\n$ttt\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-07-10 23:59:43 +02:00
|
|
|
|
|
|
|
printf "$ttt\n$ttt\n$ttt\n$ttt$ttt\n" >expect &&
|
|
|
|
printf "$ttt\n$ttt\n$ttt\n$ttt$ttt\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-07-10 23:59:43 +02:00
|
|
|
|
|
|
|
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 &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-07-10 23:59:43 +02:00
|
|
|
|
|
|
|
printf "$ttt$ttt\n\n$ttt\n$ttt$ttt\n" >expect &&
|
|
|
|
printf "$ttt$ttt\n\n$ttt\n$ttt$ttt\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual &&
|
2007-07-10 23:59:43 +02:00
|
|
|
|
|
|
|
printf "$ttt\n$ttt$ttt\n\n$ttt\n" >expect &&
|
|
|
|
printf "$ttt\n$ttt$ttt\n\n$ttt\n" | git stripspace >actual &&
|
2008-05-24 07:28:56 +02:00
|
|
|
test_cmp expect actual
|
2007-07-10 23:59:43 +02:00
|
|
|
'
|
|
|
|
|
2007-07-23 13:58:27 +02:00
|
|
|
test_expect_success 'strip comments, too' '
|
|
|
|
test ! -z "$(echo "# comment" | git stripspace)" &&
|
|
|
|
test -z "$(echo "# comment" | git stripspace -s)"
|
|
|
|
'
|
|
|
|
|
2013-01-16 20:18:48 +01:00
|
|
|
test_expect_success 'strip comments with changed comment char' '
|
|
|
|
test ! -z "$(echo "; comment" | git -c core.commentchar=";" stripspace)" &&
|
|
|
|
test -z "$(echo "; comment" | git -c core.commentchar=";" stripspace -s)"
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success '-c with single line' '
|
|
|
|
printf "# foo\n" >expect &&
|
|
|
|
printf "foo" | git stripspace -c >actual &&
|
|
|
|
test_cmp expect actual
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success '-c with single line followed by empty line' '
|
|
|
|
printf "# foo\n#\n" >expect &&
|
|
|
|
printf "foo\n\n" | git stripspace -c >actual &&
|
|
|
|
test_cmp expect actual
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success '-c with newline only' '
|
|
|
|
printf "#\n" >expect &&
|
|
|
|
printf "\n" | git stripspace -c >actual &&
|
|
|
|
test_cmp expect actual
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success '--comment-lines with single line' '
|
|
|
|
printf "# foo\n" >expect &&
|
|
|
|
printf "foo" | git stripspace -c >actual &&
|
|
|
|
test_cmp expect actual
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success '-c with changed comment char' '
|
|
|
|
printf "; foo\n" >expect &&
|
|
|
|
printf "foo" | git -c core.commentchar=";" stripspace -c >actual &&
|
|
|
|
test_cmp expect actual
|
|
|
|
'
|
|
|
|
|
2016-11-21 15:18:24 +01:00
|
|
|
test_expect_success '-c with comment char defined in .git/config' '
|
2016-11-21 15:18:05 +01:00
|
|
|
test_config core.commentchar = &&
|
|
|
|
printf "= foo\n" >expect &&
|
2018-12-17 17:59:57 +01:00
|
|
|
rm -fr sub &&
|
|
|
|
mkdir sub &&
|
|
|
|
printf "foo" | git -C sub stripspace -c >actual &&
|
|
|
|
test_cmp expect actual
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success '-c outside git repository' '
|
|
|
|
printf "# foo\n" >expect &&
|
|
|
|
printf "foo" | nongit git stripspace -c >actual &&
|
2016-11-21 15:18:05 +01:00
|
|
|
test_cmp expect actual
|
|
|
|
'
|
|
|
|
|
2014-10-27 22:13:15 +01:00
|
|
|
test_expect_success 'avoid SP-HT sequence in commented line' '
|
|
|
|
printf "#\tone\n#\n# two\n" >expect &&
|
|
|
|
printf "\tone\n\ntwo\n" | git stripspace -c >actual &&
|
|
|
|
test_cmp expect actual
|
|
|
|
'
|
|
|
|
|
2007-06-25 21:24:21 +02:00
|
|
|
test_done
|