[PATCH] tests: unify test-diffstat
Adrian Buehlmann
adrian at cadifra.com
Thu Sep 2 09:34:36 CDT 2010
# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1283437744 -7200
# Node ID 07f1fc2f1ec44a7079bd776eb8590f0cc9572d06
# Parent f896210993272b1b10f31b498eacda62d50c7f80
tests: unify test-diffstat
diff --git a/tests/test-diffstat.out b/tests/test-diffstat.out
deleted file mode 100644
--- a/tests/test-diffstat.out
+++ /dev/null
@@ -1,15 +0,0 @@
-% wide diffstat
- a | 213 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 files changed, 213 insertions(+), 0 deletions(-)
-% diffstat width
- a | 213 ++++++++++++++
- 1 files changed, 213 insertions(+), 0 deletions(-)
-% narrow diffstat
- a | 3 +++
- 1 files changed, 3 insertions(+), 0 deletions(-)
-% binary diffstat
- b | 0
- 1 files changed, 0 insertions(+), 0 deletions(-)
-% binary git diffstat
- b | Bin
- 1 files changed, 0 insertions(+), 0 deletions(-)
diff --git a/tests/test-diffstat b/tests/test-diffstat.t
old mode 100755
new mode 100644
rename from tests/test-diffstat
rename to tests/test-diffstat.t
--- a/tests/test-diffstat
+++ b/tests/test-diffstat.t
@@ -1,34 +1,48 @@
-#!/bin/sh
+ $ hg init repo
+ $ cd repo
+ $ i=0; while [ "$i" -lt 213 ]; do echo a >> a; i=`expr $i + 1`; done
+ $ hg add a
-hg init repo
-cd repo
-i=0; while [ "$i" -lt 213 ]; do echo a >> a; i=`expr $i + 1`; done
-hg add a
+Wide diffstat:
-echo '% wide diffstat'
-hg diff --stat
+ $ hg diff --stat
+ a | 213 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 files changed, 213 insertions(+), 0 deletions(-)
-echo '% diffstat width'
-COLUMNS=24 hg diff --config ui.interactive=true --stat
+diffstat width:
-hg ci -m adda
+ $ COLUMNS=24 hg diff --config ui.interactive=true --stat
+ a | 213 ++++++++++++++
+ 1 files changed, 213 insertions(+), 0 deletions(-)
-cat >> a <<EOF
-a
-a
-a
-EOF
+ $ hg ci -m adda
-echo '% narrow diffstat'
-hg diff --stat
+ $ cat >> a <<EOF
+ > a
+ > a
+ > a
+ > EOF
-hg ci -m appenda
+Narrow diffstat:
-printf '\0' > b
-hg add b
+ $ hg diff --stat
+ a | 3 +++
+ 1 files changed, 3 insertions(+), 0 deletions(-)
-echo '% binary diffstat'
-hg diff --stat
+ $ hg ci -m appenda
-echo '% binary git diffstat'
-hg diff --stat --git
+ $ printf '\0' > b
+ $ hg add b
+
+Binary diffstat:
+
+ $ hg diff --stat
+ b | 0
+ 1 files changed, 0 insertions(+), 0 deletions(-)
+
+Binary git diffstat:
+
+ $ hg diff --stat --git
+ b | Bin
+ 1 files changed, 0 insertions(+), 0 deletions(-)
+
More information about the Mercurial-devel
mailing list