# HG changeset patch # User Christian Ebert # Date 2011-11-23 01:20:32 # Node ID e5804c0f657653dfb9eac34dee49a5bb0f0053ca # Parent cea62936b39a67c8fef154815d8fe5bf969b5a72 test-keyword: use inline doctest syntax diff --git a/tests/test-keyword.t b/tests/test-keyword.t --- a/tests/test-keyword.t +++ b/tests/test-keyword.t @@ -309,8 +309,10 @@ record 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< y > y @@ -809,8 +811,9 @@ Clone to test incoming 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 ' a overwriting a expanding keywords