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

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/common/html_diff_unittest.py

Issue 2699083002: html_diff: Show context lines at the beginning/end of a file correctly. (Closed)
Patch Set: Created 3 years, 10 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 | « third_party/WebKit/Tools/Scripts/webkitpy/common/html_diff.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Tools/Scripts/webkitpy/common/html_diff_unittest.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/html_diff_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/html_diff_unittest.py
index fd8b67fac1c2f76664e63417b9f72f6ab6c9cf9b..d0a6934fb5f2e69fdc359a95bf45deb36a5d06f2 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/common/html_diff_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/html_diff_unittest.py
@@ -149,3 +149,37 @@ class TestHtmlDiff(unittest.TestCase):
'<tr><th>17<th>17<td>line17\n</tr>'
'<tr><th>18<th>18<td>line18\n</tr>'
'<tr><td colspan=3>\n\n</tr>'))
+
+ def test_html_diff_context_at_edge(self):
+ a_lines = [
+ 'line1\n',
+ 'line2\n',
+ 'line3\n',
+ 'line4\n',
+ 'line5\n',
+ 'line6\n',
+ 'line7\n',
+ 'line8\n',
+ ]
+ b_lines = [
+ 'line0\n',
+ 'line1\n',
+ 'line2\n',
+ 'line3\n',
+ 'line4\n',
+ 'line5\n',
+ 'line6\n',
+ 'line7\n',
+ 'line8\n',
+ 'line9\n',
+ ]
+ self.assertEqual(HtmlDiffGenerator().generate_tbody(a_lines, b_lines), (
+ '<tr><th><th>1<td class="add">line0\n</tr>'
+ '<tr><th>1<th>2<td>line1\n</tr>'
+ '<tr><th>2<th>3<td>line2\n</tr>'
+ '<tr><th>3<th>4<td>line3\n</tr>'
+ '<tr><td colspan=3>\n\n</tr>'
+ '<tr><th>6<th>7<td>line6\n</tr>'
+ '<tr><th>7<th>8<td>line7\n</tr>'
+ '<tr><th>8<th>9<td>line8\n</tr>'
+ '<tr><th><th>10<td class="add">line9\n</tr>'))
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/common/html_diff.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698