Patchwork [2,of,4] test-status-rev: use one glob for each expected status

login
register
mail settings
Submitter Martin von Zweigbergk
Date Nov. 5, 2014, 9:16 p.m.
Message ID <36273b9c8df456b4dfc3.1415222203@handduk2.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/6591/
State Accepted
Headers show

Comments

Martin von Zweigbergk - Nov. 5, 2014, 9:16 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1415146220 28800
#      Tue Nov 04 16:10:20 2014 -0800
# Node ID 36273b9c8df456b4dfc3dcb5c99f57377ac74801
# Parent  f6ed04e0d793f15ab49b0000428b0cddbc33c0da
test-status-rev: use one glob for each expected status

It's getting a little hard to read the ~30 calls to 'hg status' with
one per file. Instead, let's use one glob for each expected
status. For example, modified files can be listed with
'glob:content1_*_content[23]-tracked'. That also nicely becomes an
explanation for why each status is expected.

Patch

diff --git a/tests/test-status-rev.t b/tests/test-status-rev.t
--- a/tests/test-status-rev.t
+++ b/tests/test-status-rev.t
@@ -69,44 +69,41 @@ 
 
 Status compared to one revision back
 
-  $ hg status -A --rev 1 content1_content1_content1-tracked
+  $ hg status -A --rev 1 'glob:content1_*_content[23]-tracked'
+  M content1_content1_content3-tracked
+  M content1_content2_content2-tracked
+  M content1_content2_content3-tracked
+  M content1_missing_content3-tracked
+  $ hg status -A --rev 1 'glob:content1_*_content1-tracked'
   C content1_content1_content1-tracked
-BROKEN: file appears twice; should be '!'
-  $ hg status -A --rev 1 content1_content1_missing-tracked
+  C content1_content2_content1-tracked
+  C content1_missing_content1-tracked
+  $ hg status -A --rev 1 'glob:missing_*_content?-tracked'
+  A missing_content2_content2-tracked
+  A missing_content2_content3-tracked
+  A missing_missing_content3-tracked
+BROKEN: missing_content2_content[23]-untracked exist, so should be listed
+  $ hg status -A --rev 1 'glob:missing_*_content?-untracked'
+  ? missing_missing_content3-untracked
+  $ hg status -A --rev 1 'glob:content1_*_*-untracked'
+  R content1_content1_content1-untracked
+  R content1_content1_content3-untracked
+  R content1_content1_missing-untracked
+  R content1_content2_content1-untracked
+  R content1_content2_content2-untracked
+  R content1_content2_content3-untracked
+  R content1_content2_missing-untracked
+  R content1_missing_content1-untracked
+  R content1_missing_content3-untracked
+  R content1_missing_missing-untracked
+BROKEN: content1_*_missing-tracked appear twice; should just be '!'
+  $ hg status -A --rev 1 'glob:*_*_missing-tracked'
+  R content1_missing_missing-tracked
   ! content1_content1_missing-tracked
+  ! content1_content2_missing-tracked
+  ! content1_missing_missing-tracked
+  ! missing_content2_missing-tracked
+  ! missing_missing_missing-tracked
   C content1_content1_missing-tracked
-  $ hg status -A --rev 1 content1_content1_content1-untracked
-  R content1_content1_content1-untracked
-  $ hg status -A --rev 1 content1_content1_content3-tracked
-  M content1_content1_content3-tracked
-  $ hg status -A --rev 1 content1_content1_missing-untracked
-  R content1_content1_missing-untracked
-  $ hg status -A --rev 1 content1_content2_content2-tracked
-  M content1_content2_content2-tracked
-BROKEN: file appears twice; should be '!'
-  $ hg status -A --rev 1 content1_content2_missing-tracked
-  ! content1_content2_missing-tracked
   C content1_content2_missing-tracked
-  $ hg status -A --rev 1 content1_content2_content2-untracked
-  R content1_content2_content2-untracked
-  $ hg status -A --rev 1 content1_content2_content3-tracked
-  M content1_content2_content3-tracked
-  $ hg status -A --rev 1 content1_content2_missing-untracked
-  R content1_content2_missing-untracked
-  $ hg status -A --rev 1 content1_missing_content3-tracked
-  M content1_missing_content3-tracked
-BROKEN: file appears twice; should be '!'
-  $ hg status -A --rev 1 content1_missing_missing-tracked
-  R content1_missing_missing-tracked
-  ! content1_missing_missing-tracked
-  $ hg status -A --rev 1 content1_missing_content3-untracked
-  R content1_missing_content3-untracked
-  $ hg status -A --rev 1 missing_content2_missing-tracked
-  ! missing_content2_missing-tracked
-BROKEN: file exists, so should be listed (as '?')
-  $ hg status -A --rev 1 missing_content2_content2-untracked
-  $ hg status -A --rev 1 missing_content2_content3-tracked
-  A missing_content2_content3-tracked
-  $ hg status -A --rev 1 missing_content2_missing-untracked
-  $ hg status -A --rev 1 missing_missing_content3-untracked
-  ? missing_missing_content3-untracked
+  $ hg status -A --rev 1 'glob:missing_*_missing-untracked'