diff --stat: add a test for output with COLUMNS=40

In preparation for the introduction on the limit of the width of the graph part, a new test with COLUMNS=40 is added to check that the environment variable influences diff, show, log, but not format-patch. A new test is added because limiting the graph part makes COLUMNS=200 stop influencing diff --stat behaviour, which isn't wide enough now. The old test with COLUMNS=200 is retained to check for regressions. Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Zbigniew Jędrzejewski-Szmek committed Mar 1, 2012 at 13:26 UTC c4432d5511f2897b56cd921632c86c1e2ca78159
1 file changed +19
t/t4052-stat-output.sh
+19
@@ -101,6 +101,25 @@ respects expect200 show --stat
101 respects expect200 log -1 --stat
102 EOF
103
104 +cat >expect40 <<'EOF'
105 + abcd | 1000 ++++++++++++++++++++++++++
106 +EOF
107 +
108 +while read verb expect cmd args
109 +do
110 + test_expect_success "$cmd $verb not enough COLUMNS (big change)" '
111 + COLUMNS=40 git $cmd $args >output
112 + grep " | " output >actual &&
113 + test_cmp "$expect" actual
114 + '
115 +done <<\EOF
116 +ignores expect80 format-patch -1 --stdout
117 +respects expect40 diff HEAD^ HEAD --stat
118 +respects expect40 show --stat
119 +respects expect40 log -1 --stat
120 +EOF
121 +
122 +
123 cat >expect <<'EOF'
124 abcd | 1000 ++++++++++++++++++++++++++
125 EOF