Skip to content

Commit 12b013f

Browse files
createthisCISC
andauthored
Update tests/test-chat-parser.cpp
Co-authored-by: Sigbjørn Skjæret <[email protected]>
1 parent f661dbe commit 12b013f

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

tests/test-chat-parser.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@
1414
#include "log.h"
1515
#include "regex-partial.h"
1616

17-
template<class T>
18-
static void assert_equals(const char* label, const T& expected, const T& actual) {
19-
if (expected != actual){
20-
std::ostringstream oss;
21-
if (label && *label) oss << label << '\n';
22-
oss << "Expected: " << expected << "\nActual: " << actual;
23-
throw std::runtime_error(oss.str());
17+
template <class T>
18+
static void assert_equals(const std::string & label, const T & expected, const T & actual) {
19+
if (expected != actual) {
20+
std::cerr << label << std::endl;
21+
std::cerr << "Expected: " << expected << std::endl;
22+
std::cerr << "Actual: " << actual << std::endl;
23+
std::cerr << std::flush;
24+
throw std::runtime_error("Test failed");
2425
}
2526
}
2627

0 commit comments

Comments
 (0)