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

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

Issue 2595983002: Extract diff_text function out of the Port class. (Closed)
Patch Set: Change indentation Created 3 years, 11 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/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: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py
index 76006bba63057271af0027e991d1eab2d3999df7..355e5d75fc791055671b0eb401cda6e8c42a330a 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py
@@ -112,39 +112,6 @@ class PortTest(unittest.TestCase):
port._run_wdiff = lambda a, b: 'PASS'
self.assertEqual('PASS', port.wdiff_text(None, None))
- def test_diff_text(self):
- port = self.make_port()
- # Make sure that we don't run into decoding exceptions when the
- # filenames are unicode, with regular or malformed input (expected or
- # actual input is always raw bytes, not unicode).
- port.diff_text('exp', 'act', 'exp.txt', 'act.txt')
- port.diff_text('exp', 'act', u'exp.txt', 'act.txt')
- port.diff_text('exp', 'act', u'a\xac\u1234\u20ac\U00008000', 'act.txt')
-
- port.diff_text('exp' + chr(255), 'act', 'exp.txt', 'act.txt')
- port.diff_text('exp' + chr(255), 'act', u'exp.txt', 'act.txt')
-
- # Though expected and actual files should always be read in with no
- # encoding (and be stored as str objects), test unicode inputs just to
- # be safe.
- port.diff_text(u'exp', 'act', 'exp.txt', 'act.txt')
- port.diff_text(
- u'a\xac\u1234\u20ac\U00008000', 'act', 'exp.txt', 'act.txt')
-
- # And make sure we actually get diff output.
- diff = port.diff_text('foo', 'bar', 'exp.txt', 'act.txt')
- self.assertIn('foo', diff)
- self.assertIn('bar', diff)
- self.assertIn('exp.txt', diff)
- 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 | « third_party/WebKit/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