From 58748d0ca713c7d2a87b97f4c4a6048c226a4e60 Mon Sep 17 00:00:00 2001 From: pajlada Date: Sun, 19 Jan 2025 17:15:02 +0100 Subject: [PATCH] chore(tests): print more errors when snapshot tests fail (#5839) --- tests/src/IrcMessageHandler.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/src/IrcMessageHandler.cpp b/tests/src/IrcMessageHandler.cpp index 8a0013e50b9..14790e7cac0 100644 --- a/tests/src/IrcMessageHandler.cpp +++ b/tests/src/IrcMessageHandler.cpp @@ -603,7 +603,11 @@ TEST_P(TestIrcMessageHandlerP, Run) delete ircMessage; - ASSERT_TRUE(snapshot->run(got, UPDATE_SNAPSHOTS)); + ASSERT_TRUE(snapshot->run(got, UPDATE_SNAPSHOTS)) + << "Snapshot " << snapshot->name() << " failed. Expected JSON to be\n" + << QJsonDocument::fromVariant(snapshot->output().toVariant()).toJson() + << "\nbut got\n" + << QJsonDocument(got).toJson() << "\ninstead."; } INSTANTIATE_TEST_SUITE_P(