changeset 15556:e5804c0f6576

test-keyword: use inline doctest syntax
author Christian Ebert <blacktrash@gmx.net>
date Wed, 23 Nov 2011 01:20:32 +0000
parents cea62936b39a
children 7bb5ed61b74c
files tests/test-keyword.t
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-keyword.t	Tue Nov 22 17:34:22 2011 -0600
+++ b/tests/test-keyword.t	Wed Nov 23 01:20:32 2011 +0000
@@ -309,8 +309,10 @@
 
 record chunk
 
-  $ python -c \
-  > 'l=open("a").readlines();l.insert(1,"foo\n");l.append("bar\n");open("a","w").writelines(l);'
+  >>> lines = open('a').readlines()
+  >>> lines.insert(1, 'foo\n')
+  >>> lines.append('bar\n')
+  >>> open('a', 'w').writelines(lines)
   $ hg record -d '1 10' -m rectest a<<EOF
   > y
   > y
@@ -809,8 +811,9 @@
   
 Imported patch should not be rejected
 
-  $ python -c \
-  > 'import re; s=re.sub("(Id.*)","\\1 rejecttest",open("a").read()); open("a","wb").write(s);'
+  >>> import re
+  >>> text = re.sub(r'(Id.*)', r'\1 rejecttest', open('a').read())
+  >>> open('a', 'wb').write(text)
   $ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>'
   a
   overwriting a expanding keywords