Bug 1063528 - Omit spurious newline for unexpected pass in the tbplformatter.;r=Ms2ger

This commit is contained in:
Chris Manchester 2014-09-05 11:37:57 -04:00
parent 856512d217
commit 3a18f5f79a
2 changed files with 16 additions and 1 deletions

View File

@ -75,7 +75,7 @@ class TbplFormatter(BaseFormatter):
if "expected" in data:
if not message:
message = "- expected %s\n" % data["expected"]
message = "- expected %s" % data["expected"]
failure_line = "TEST-UNEXPECTED-%s | %s | %s %s\n" % (
data["status"], self.id_str(data["test"]), data["subtest"],
message)

View File

@ -454,6 +454,21 @@ class TestTBPLFormatter(FormatterTest):
self.logger.test_end("timeout_test", "OK")
self.logger.suite_end()
def test_single_newline(self):
self.logger.suite_start([])
self.logger.test_start("test1")
self.set_position()
self.logger.test_status("test1", "subtest",
status="PASS",
expected="FAIL")
self.logger.test_end("test1", "OK")
self.logger.suite_end()
# This sequence should not produce blanklines
for line in self.loglines:
self.assertNotEqual("", line, "No blank line should be present in: %s" %
self.loglines)
class TestMachFormatter(FormatterTest):