Changeset 90942 in webkit
- Timestamp:
- Jul 13, 2011 12:40:09 PM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r90941 r90942 1 2011-07-13 Dimitri Glazkov <dglazkov@chromium.org> 2 3 Introduce TestExpectationSerializer.list_to_string. 4 https://bugs.webkit.org/show_bug.cgi?id=64462 5 6 Reviewed by Adam Barth. 7 8 * Scripts/webkitpy/layout_tests/models/test_expectations.py: Added list_to_string and change the relevant callsite to use it. 9 * Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py: Added tests for it. 10 1 11 2011-07-13 Dimitri Glazkov <dglazkov@chromium.org> 2 12 -
trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py
r90941 r90942 158 158 return ''.join(result) 159 159 160 @classmethod 161 def list_to_string(cls, expectations): 162 return "\n".join([TestExpectationSerializer.to_string(expectation) for expectation in expectations]) 163 160 164 161 165 class TestExpectationParser: … … 508 512 def remove_rebaselined_tests(self, tests): 509 513 """Returns a copy of the expectations with the tests removed.""" 510 lines = [] 511 for expectation in self._expectations: 512 if not (expectation.valid and expectation.name in tests and "rebaseline" in expectation.modifiers): 513 lines.append(TestExpectationSerializer.to_string(expectation)) 514 return "\n".join(lines) 514 def without_rebaseline_modifier(expectation): 515 return not (expectation.valid and expectation.name in tests and "rebaseline" in expectation.modifiers) 516 517 return TestExpectationSerializer.list_to_string(filter(without_rebaseline_modifier, self._expectations)) 515 518 516 519 def _add_to_all_expectations(self, test, options, expectations): -
trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py
r90934 r90942 558 558 self.assertEqual(expected_string, TestExpectationSerializer.to_string(expectation)) 559 559 560 def assert_list_round_trip(self, in_string, expected_string=None): 561 expectations = TestExpectationParser.parse_list(in_string, TestValidator()) 562 if expected_string is None: 563 expected_string = in_string 564 self.assertEqual(expected_string, TestExpectationSerializer.list_to_string(expectations)) 565 560 566 def assert_to_string(self, expectation, expected_string): 561 567 self.assertEqual(TestExpectationSerializer.to_string(expectation), expected_string) … … 603 609 self.assert_round_trip('// Foo : =') 604 610 611 def test_list_roundtrip(self): 612 self.assert_list_round_trip('') 613 self.assert_list_round_trip('\n') 614 self.assert_list_round_trip('\n\n') 615 self.assert_list_round_trip('bar') 616 self.assert_list_round_trip('bar\n//Qux.') 617 self.assert_list_round_trip('bar\n//Qux.\n') 618 605 619 def test_string_whitespace_stripping(self): 606 620 self.assert_round_trip('\n', '')
Note: See TracChangeset
for help on using the changeset viewer.