Patchwork tests: work around FreeBSD's unzip having slightly different output

login
register
mail settings
Submitter Augie Fackler
Date Jan. 19, 2017, 5:06 a.m.
Message ID <f1b9a08107361b03dbdd.1484802390@imladris.local>
Download mbox | patch
Permalink /patch/18247/
State Accepted
Headers show

Comments

Augie Fackler - Jan. 19, 2017, 5:06 a.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1484801021 18000
#      Wed Jan 18 23:43:41 2017 -0500
# Branch stable
# Node ID f1b9a08107361b03dbdd3d7200c3126e0de10864
# Parent  41d220e2bed95664c335f6a7ef70b8ce06dca86c
tests: work around FreeBSD's unzip having slightly different output

According to man 1 unzip, this unzip appeared in FreeBSD 8.0. It's
what comes as /usr/bin/unzip, so we may as well cater to it since it's
easy.
via Mercurial-devel - Jan. 19, 2017, 5:32 a.m.
Queued, thanks.

On Wed, Jan 18, 2017 at 9:06 PM, Augie Fackler <raf@durin42.com> wrote:
> # HG changeset patch
> # User Augie Fackler <augie@google.com>
> # Date 1484801021 18000
> #      Wed Jan 18 23:43:41 2017 -0500
> # Branch stable
> # Node ID f1b9a08107361b03dbdd3d7200c3126e0de10864
> # Parent  41d220e2bed95664c335f6a7ef70b8ce06dca86c
> tests: work around FreeBSD's unzip having slightly different output
>
> According to man 1 unzip, this unzip appeared in FreeBSD 8.0. It's
> what comes as /usr/bin/unzip, so we may as well cater to it since it's
> easy.
>
> diff --git a/tests/test-archive.t b/tests/test-archive.t
> --- a/tests/test-archive.t
> +++ b/tests/test-archive.t
> @@ -327,14 +327,11 @@ old file -- date clamped to 1980
>    $ hg add old
>    $ hg commit -m old
>    $ hg archive ../old.zip
> -  $ unzip -l ../old.zip
> +  $ unzip -l ../old.zip | grep -v -- ----- | egrep -v files$
>    Archive:  ../old.zip
>    \s*Length.* (re)
> -  *-----* (glob)
>    *172*80*00:00*old/.hg_archival.txt (glob)
>    *0*80*00:00*old/old (glob)
> -  *-----* (glob)
> -  \s*172\s+2 files (re)
>
>  show an error when a provided pattern matches no files
>
> diff --git a/tests/test-subrepo-recursion.t b/tests/test-subrepo-recursion.t
> --- a/tests/test-subrepo-recursion.t
> +++ b/tests/test-subrepo-recursion.t
> @@ -321,10 +321,9 @@ Test archiving to zip file (unzip output
>
>  (unzip date formating is unstable, we do not care about it and glob it out)
>
> -  $ unzip -l ../archive.zip
> +  $ unzip -l ../archive.zip | grep -v -- ----- | egrep -v files$
>    Archive:  ../archive.zip
>      Length [ ]* Date [ ]* Time [ ]* Name (re)
> -  [\- ]* (re)
>          172  [0-9:\- ]*  .hg_archival.txt (re)
>           10  [0-9:\- ]*  .hgsub (re)
>           45  [0-9:\- ]*  .hgsubstate (re)
> @@ -333,8 +332,6 @@ Test archiving to zip file (unzip output
>           45  [0-9:\- ]*  foo/.hgsubstate (re)
>            9  [0-9:\- ]*  foo/y.txt (re)
>            9  [0-9:\- ]*  foo/bar/z.txt (re)
> -  [\- ]* (re)
> -        303  [ ]*        8 files (re)
>
>  Test archiving a revision that references a subrepo that is not yet
>  cloned:
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff --git a/tests/test-archive.t b/tests/test-archive.t
--- a/tests/test-archive.t
+++ b/tests/test-archive.t
@@ -327,14 +327,11 @@  old file -- date clamped to 1980
   $ hg add old
   $ hg commit -m old
   $ hg archive ../old.zip
-  $ unzip -l ../old.zip
+  $ unzip -l ../old.zip | grep -v -- ----- | egrep -v files$
   Archive:  ../old.zip
   \s*Length.* (re)
-  *-----* (glob)
   *172*80*00:00*old/.hg_archival.txt (glob)
   *0*80*00:00*old/old (glob)
-  *-----* (glob)
-  \s*172\s+2 files (re)
 
 show an error when a provided pattern matches no files
 
diff --git a/tests/test-subrepo-recursion.t b/tests/test-subrepo-recursion.t
--- a/tests/test-subrepo-recursion.t
+++ b/tests/test-subrepo-recursion.t
@@ -321,10 +321,9 @@  Test archiving to zip file (unzip output
 
 (unzip date formating is unstable, we do not care about it and glob it out)
 
-  $ unzip -l ../archive.zip
+  $ unzip -l ../archive.zip | grep -v -- ----- | egrep -v files$
   Archive:  ../archive.zip
     Length [ ]* Date [ ]* Time [ ]* Name (re)
-  [\- ]* (re)
         172  [0-9:\- ]*  .hg_archival.txt (re)
          10  [0-9:\- ]*  .hgsub (re)
          45  [0-9:\- ]*  .hgsubstate (re)
@@ -333,8 +332,6 @@  Test archiving to zip file (unzip output
          45  [0-9:\- ]*  foo/.hgsubstate (re)
           9  [0-9:\- ]*  foo/y.txt (re)
           9  [0-9:\- ]*  foo/bar/z.txt (re)
-  [\- ]* (re)
-        303  [ ]*        8 files (re)
 
 Test archiving a revision that references a subrepo that is not yet
 cloned: