Re: [PATCH v4 3/4] t4052: Test diff-stat output with minimum columns
- From
Kacper Kornet <draenog@pld-linux.org>
- Date
- Apr 26, 2012, 22:34 UTC
- Message-ID
- <20120426223422.GC22261@camk.edu.pl>
- In-Reply-To
- <1334783377-31229-1-git-send-email-lucian.poston@gmail.com>
On Wed, Apr 18, 2012 at 02:09:33PM -0700, Lucian Poston wrote:
> When COLUMNS or --stat-width restricts the diff-stat width to near the > minimum, 26 columns, the graph_width value becomes negative. Consequently, the > graph part of diff-stat is not resized properly.
> Signed-off-by: Lucian Poston <lucian.poston@gmail.com> > --- > t/t4052-stat-output.sh | 28 ++++++++++++++++++++++++++++ > 1 files changed, 28 insertions(+), 0 deletions(-)
Show 7 quoted lines
> diff --git a/t/t4052-stat-output.sh b/t/t4052-stat-output.sh > index d748e5e..b8eec8f 100755 > --- a/t/t4052-stat-output.sh > +++ b/t/t4052-stat-output.sh > @@ -284,6 +284,34 @@ respects expect200 show --stat > respects expect200 log -1 --stat > EOF
Show 31 quoted lines
> +cat >expect1 <<'EOF' > + ...aaaaaaa | 1000 ++++++ > +EOF > +cat >expect1-graph <<'EOF' > +| ...aaaaaaa | 1000 ++++++ > +EOF > +while read teststate verb expect cmd args > +do > + test_expect_$teststate "$cmd $verb prefix greater than COLUMNS (big change)" ' > + COLUMNS=1 git $cmd $args >output > + grep " | " output >actual && > + test_cmp "$expect" actual > + ' > + > + test "$cmd" != diff || continue > + > + test_expect_$teststate "$cmd --graph $verb prefix greater than COLUMNS (big change)" ' > + COLUMNS=1 git $cmd $args --graph >output > + grep " | " output >actual && > + test_cmp "$expect-graph" actual > + ' > +done <<\EOF > +success ignores expect80 format-patch -1 --stdout > +failure respects expect1 diff HEAD^ HEAD --stat > +failure respects expect1 show --stat > +failure respects expect1 log -1 --stat > +EOF > + > cat >expect <<'EOF' > abcd | 1000 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > EOF
These tests fail when /bin/sh is mksh. The problem is, mksh set COLUMNS to be at least 12.
-- Kacper Kornet