Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1613)

Unified Diff: tests/git_cl_test.py

Issue 14265007: Fix R= line handling when there is no value and improve presubmit TAG line regex (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Also check no trigger on whitespace Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « presubmit_support.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/git_cl_test.py
diff --git a/tests/git_cl_test.py b/tests/git_cl_test.py
index ae71c1cd7d4a22fcdde6c6f53987c9aeeed1fe4d..797c4ccaee95b445b88321326bd34434c97ec209 100755
--- a/tests/git_cl_test.py
+++ b/tests/git_cl_test.py
@@ -612,11 +612,23 @@ class TestGitCl(TestCase):
('foo\nBUG=', ['a@c'], 'foo\nBUG=\nR=a@c'),
('foo\nR=xx\nTBR=yy\nR=bar', ['a@c'], 'foo\nTBR=a@c'),
('foo', ['a@c', 'b@c'], 'foo\n\nR=a@c, b@c'),
+ ('foo\nBar\n\nR=\nBUG=', ['c@c'], 'foo\nBar\n\nR=c@c\nBUG='),
+ ('foo\nBar\n\nR=\nBUG=\nR=', ['c@c'], 'foo\nBar\n\nR=c@c\nBUG='),
+ # Same as the line before, but full of whitespaces.
+ (
+ 'foo\nBar\n\n R = \n BUG = \n R = ', ['c@c'],
+ 'foo\nBar\n\nR=c@c\n BUG =',
+ ),
+ # Whitespaces aren't interpreted as new lines.
+ ('foo BUG=allo R=joe ', ['c@c'], 'foo BUG=allo R=joe\n\nR=c@c'),
]
- for orig, reviewers, expected in data:
+ expected = [i[2] for i in data]
+ actual = []
+ for orig, reviewers, _expected in data:
obj = git_cl.ChangeDescription(orig)
obj.update_reviewers(reviewers)
- self.assertEqual(expected, obj.description)
+ actual.append(obj.description)
+ self.assertEqual(expected, actual)
if __name__ == '__main__':
« no previous file with comments | « presubmit_support.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698