Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
None
-
None
Description
QStringList a{ u"Hello"_s, u"World"_s }; QStringList b{ u"Helo"_s, u"Wrld"_s }; QCOMPARE(a, b);
gives:
```
FAIL! : myTest() Compared lists differ at index 0.
Actual (a): "Hello"
Expected (b): "Helo"
Loc: [/home/tim/dev/...]
```
while this is certainly correct, it would be interesting to see more diagnostic output, e.g. both actual and expected outputs.
compare the catch2 output for example:
#include <catch2/catch_test_macros.hpp> #include <catch2/catch_session.hpp> #include <vector> int main( int argc, char* argv[] ) { int result = Catch::Session().run( argc, argv ); return result; } TEST_CASE( "myTest" ) { std::vector a{1, 2}, b{2, 3}; CHECK(a == b); }
/app/example.cpp:13: FAILED: CHECK( a == b ) with expansion: { 1, 2 } == { 2, 3 }
Attachments
Issue Links
- relates to
-
QTBUG-130477 QCOMPARE's debug output unhelpful on long strings
-
- Open
-