| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import unittest | 5 import unittest |
| 6 | 6 |
| 7 from webkitpy.common.html_diff import HtmlDiffGenerator, html_diff | 7 from webkitpy.common.html_diff import HtmlDiffGenerator, html_diff |
| 8 | 8 |
| 9 | 9 |
| 10 class TestHtmlDiff(unittest.TestCase): | 10 class TestHtmlDiff(unittest.TestCase): |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 '<tr><th>11<th>11<td>line11\n</tr>' | 142 '<tr><th>11<th>11<td>line11\n</tr>' |
| 143 '<tr><th>12<th>12<td>line12\n</tr>' | 143 '<tr><th>12<th>12<td>line12\n</tr>' |
| 144 '<tr><th>13<th>13<td>line13\n</tr>' | 144 '<tr><th>13<th>13<td>line13\n</tr>' |
| 145 '<tr><th>14<th>14<td>line14\n</tr>' | 145 '<tr><th>14<th>14<td>line14\n</tr>' |
| 146 '<tr><th>15<th><td class="del">line15a\n</tr>' | 146 '<tr><th>15<th><td class="del">line15a\n</tr>' |
| 147 '<tr><th><th>15<td class="add">line15b\n</tr>' | 147 '<tr><th><th>15<td class="add">line15b\n</tr>' |
| 148 '<tr><th>16<th>16<td>line16\n</tr>' | 148 '<tr><th>16<th>16<td>line16\n</tr>' |
| 149 '<tr><th>17<th>17<td>line17\n</tr>' | 149 '<tr><th>17<th>17<td>line17\n</tr>' |
| 150 '<tr><th>18<th>18<td>line18\n</tr>' | 150 '<tr><th>18<th>18<td>line18\n</tr>' |
| 151 '<tr><td colspan=3>\n\n</tr>')) | 151 '<tr><td colspan=3>\n\n</tr>')) |
| 152 |
| 153 def test_html_diff_context_at_edge(self): |
| 154 a_lines = [ |
| 155 'line1\n', |
| 156 'line2\n', |
| 157 'line3\n', |
| 158 'line4\n', |
| 159 'line5\n', |
| 160 'line6\n', |
| 161 'line7\n', |
| 162 'line8\n', |
| 163 ] |
| 164 b_lines = [ |
| 165 'line0\n', |
| 166 'line1\n', |
| 167 'line2\n', |
| 168 'line3\n', |
| 169 'line4\n', |
| 170 'line5\n', |
| 171 'line6\n', |
| 172 'line7\n', |
| 173 'line8\n', |
| 174 'line9\n', |
| 175 ] |
| 176 self.assertEqual(HtmlDiffGenerator().generate_tbody(a_lines, b_lines), ( |
| 177 '<tr><th><th>1<td class="add">line0\n</tr>' |
| 178 '<tr><th>1<th>2<td>line1\n</tr>' |
| 179 '<tr><th>2<th>3<td>line2\n</tr>' |
| 180 '<tr><th>3<th>4<td>line3\n</tr>' |
| 181 '<tr><td colspan=3>\n\n</tr>' |
| 182 '<tr><th>6<th>7<td>line6\n</tr>' |
| 183 '<tr><th>7<th>8<td>line7\n</tr>' |
| 184 '<tr><th>8<th>9<td>line8\n</tr>' |
| 185 '<tr><th><th>10<td class="add">line9\n</tr>')) |
| OLD | NEW |