Patchwork [3,of,3] tests: add a new test-terse-status.t with tests related to terse flag

login
register
mail settings
Submitter Pulkit Goyal
Date June 14, 2017, 9:02 p.m.
Message ID <a5027ac9499e9b647f88.1497474160@workspace>
Download mbox | patch
Permalink /patch/21381/
State Changes Requested
Headers show

Comments

Pulkit Goyal - June 14, 2017, 9:02 p.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1497474018 -19800
#      Thu Jun 15 02:30:18 2017 +0530
# Node ID a5027ac9499e9b647f88cea8f2a09399c488d61e
# Parent  312ec8385177d5780851ae1e682ea992a99a17ba
tests: add a new test-terse-status.t with tests related to terse flag

This adds a new test containing some basic tests related to the terse flag of
the status command. The --terse flag can result in buggy output so we need to
have good testing for that.

More tests will be added by future patches.
via Mercurial-devel - June 16, 2017, 6:18 p.m.
On Wed, Jun 14, 2017 at 2:02 PM, Pulkit Goyal <7895pulkit@gmail.com> wrote:
> # HG changeset patch
> # User Pulkit Goyal <7895pulkit@gmail.com>
> # Date 1497474018 -19800
> #      Thu Jun 15 02:30:18 2017 +0530
> # Node ID a5027ac9499e9b647f88cea8f2a09399c488d61e
> # Parent  312ec8385177d5780851ae1e682ea992a99a17ba
> tests: add a new test-terse-status.t with tests related to terse flag

I'd prefer to see these three patches squashed in v2. Splitting up
into 3 makes it harder for me to follow and it's not going to help
bisection either.

Patch

diff --git a/tests/test-terse-status.t b/tests/test-terse-status.t
new file mode 100644
--- /dev/null
+++ b/tests/test-terse-status.t
@@ -0,0 +1,106 @@ 
+  $ mkdir folder
+  $ cd folder
+  $ hg init
+  $ mkdir x
+  $ touch a b x/aa.o x/bb.o
+  $ hg status
+  ? a
+  ? b
+  ? x/aa.o
+  ? x/bb.o
+
+Show that only passed status are tersed
+  $ hg status --terse m
+  ? a
+  ? b
+  ? x/aa.o
+  ? x/bb.o
+  $ hg status --terse a
+  ? a
+  ? b
+  ? x/aa.o
+  ? x/bb.o
+  $ hg status --terse u
+  ? a
+  ? b
+  ? x/
+  $ hg status --terse i
+  ? a
+  ? b
+  ? x/aa.o
+  ? x/bb.o
+  $ hg status --terse r
+  ? a
+  ? b
+  ? x/aa.o
+  ? x/bb.o
+  $ hg status --terse d
+  ? a
+  ? b
+  ? x/aa.o
+  ? x/bb.o
+  $ hg status --terse c
+  ? a
+  ? b
+  ? x/aa.o
+  ? x/bb.o
+  $ hg status --terse maudric
+  ? a
+  ? b
+  ? x/
+  $ hg status --terse f
+  abort: Unable to parse the terse status, use marduic
+  [255]
+
+Have a .hgignore so that we can also have ignored files
+
+  $ echo ".*\.o" > .hgignore
+  $ hg status
+  ? .hgignore
+  ? a
+  ? b
+  $ hg status -i
+  I x/aa.o
+  I x/bb.o
+
+  $ hg status -t i
+  ? .hgignore
+  ? a
+  ? b
+  I x/
+
+Test interaction of ignore with other statuses while tersing
+
+  $ hg status -t maudric
+  ? .hgignore
+  ? a
+  ? b
+  I x/
+
+  $ touch x/aa x/bb
+  $ hg status -t marduc
+  ? .hgignore
+  ? a
+  ? b
+  ? x/
+  $ hg status -t mardiuc
+  ? .hgignore
+  ? a
+  ? b
+  ? x/aa
+  ? x/bb
+  I x/aa.o
+  I x/bb.o
+  $ hg add x/
+  adding x/aa
+  adding x/bb
+  $ hg status -t marduc
+  A x/
+  ? .hgignore
+  ? a
+  ? b
+  $ hg status -t marduc -a
+  A x/
+  $ hg status -t marduic -a
+  A x/aa
+  A x/bb