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. |