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

Unified Diff: Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py

Issue 423073004: Fix diff generation by difflib to report missing end of file newlines. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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 | « Tools/Scripts/webkitpy/layout_tests/port/base.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py
index e5ab43da9aad47448d671b9012a1e08c46884480..437fd400b3b73427492a49ca810294aae9d01080 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py
@@ -143,6 +143,12 @@ class PortTest(unittest.TestCase):
self.assertIn('act.txt', diff)
self.assertNotIn('nosuchthing', diff)
+ # Test for missing newline at end of file diff output.
+ content_a = "Hello\n\nWorld"
+ content_b = "Hello\n\nWorld\n\n\n"
+ expected = "--- exp.txt\n+++ act.txt\n@@ -1,3 +1,5 @@\n Hello\n \n-World\n\ No newline at end of file\n+World\n+\n+\n"
+ self.assertEqual(expected, port.diff_text(content_a, content_b, 'exp.txt', 'act.txt'))
+
def test_setup_test_run(self):
port = self.make_port()
# This routine is a no-op. We just test it for coverage.
« no previous file with comments | « Tools/Scripts/webkitpy/layout_tests/port/base.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698