[PATCH 0 of 1] tests: unify test-keyword

Matt Mackall mpm at selenic.com
Fri Aug 13 18:37:49 UTC 2010


On Fri, 2010-08-13 at 14:03 +0100, Christian Ebert wrote:
> Hi,
> 
> Doing the conversion manually was actually quite interesting ;-)
> 
> Somehow the little regex machine didn't help me with one huge sed
> filter at all. I suspect that's because the output lines start
> with $.

Here's the trick:

diff -r 1c08cf21d0a6 tests/test-keyword.t
--- a/tests/test-keyword.t	Fri Aug 13 13:54:33 2010 +0100
+++ b/tests/test-keyword.t	Fri Aug 13 13:34:26 2010 -0500
@@ -12,11 +12,7 @@
 Run kwdemo before [keyword] files are set up
 as it would succeed without uisetup otherwise
 
-  $ hg --quiet kwdemo \
-  > | sed -e 's![^ ][^ ]*demo.txt,v!/TMP/demo.txt,v!' \
-  >  -e 's/,v [a-z0-9][a-z0-9]* /,v xxxxxxxxxxxx /' \
-  >  -e '/[$]Revision/ s/: [a-z0-9][a-z0-9]* /: xxxxxxxxxxxx /' \
-  >  -e 's! 20[0-9][0-9]/[01][0-9]/[0-3][0-9] [0-2][0-9]:[0-6][0-9]:[0-6][0-9]! 2000/00/00 00:00:00!'
+  $ hg --quiet kwdemo
   [extensions]
   keyword =
   [keyword]
@@ -30,14 +26,14 @@
   RCSfile = {file|basename},v
   Revision = {node|short}
   Source = {root}/{file},v
-  $Author: test $
-  $Date: 2000/00/00 00:00:00 $
-  $Header: /TMP/demo.txt,v xxxxxxxxxxxx 2000/00/00 00:00:00 test $
-  $Id: demo.txt,v xxxxxxxxxxxx 2000/00/00 00:00:00 test $
-  $RCSFile: demo.txt,v $
-  $RCSfile: demo.txt,v $
-  $Revision: xxxxxxxxxxxx $
-  $Source: /TMP/demo.txt,v $
+  \$Author: test \$
+  \$Date: ..../../.. ..:..:.. \$
+  \$Header: .*/demo.txt,v ............ ..../../.. ..:..:.. test \$
+  \$Id: demo.txt,v ............ ..../../.. ..:..:.. test \$
+  \$RCSFile: demo.txt,v \$
+  \$RCSfile: demo.txt,v \$
+  \$Revision: ............ \$
+  \$Source: .*/demo.txt,v \$
 
   $ hg --quiet kwdemo "Branch = {branches}"
   [extensions]

-- 
Mathematics is the supreme nostalgia of our time.





More information about the Mercurial-devel mailing list