From aaa25ac376f2c6e68a46afacd552bc0f50052e6e Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Sun, 28 Aug 2016 14:22:11 -0600 Subject: [PATCH] Improve diagnostic output for output tests. --- test/output_test_helper.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/test/output_test_helper.cc b/test/output_test_helper.cc index 27bff8df..4bd95efe 100644 --- a/test/output_test_helper.cc +++ b/test/output_test_helper.cc @@ -70,13 +70,17 @@ void CheckCase(std::stringstream& remaining_output, TestCase const& TC, on_first = false; } for (auto& NC : not_checks) { - CHECK(!NC.regex->Match(line)) << "Unexpected match for line \"" - << line << "\" for MR_Not regex \"" - << NC.regex_str << "\""; + CHECK(!NC.regex->Match(line)) + << "Unexpected match for line \"" << line + << "\" for MR_Not regex \"" << NC.regex_str << "\"" + << "\n actual regex string \"" << TC.substituted_regex << "\"" + << "\n started matching near: " << first_line; } if (TC.regex->Match(line)) return; - CHECK(TC.match_rule != MR_Next) << "Expected line \"" << line - << "\" to match regex \"" << TC.regex_str << "\""; + CHECK(TC.match_rule != MR_Next) + << "Expected line \"" << line << "\" to match regex \"" << TC.regex_str << "\"" + << "\n actual regex string \"" << TC.substituted_regex << "\"" + << "\n started matching near: " << first_line; } CHECK(remaining_output.eof() == false) << "End of output reached before match for regex \"" << TC.regex_str