Not seeing some error messages from fakeit in jetbrains rider

Open Beginner friendly
#3,228 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

@Amanpal9 is already working on this.

Since Nov 6, 2026.

  • #3232 by @Amanpal9 — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp
Domain
testing

Research direction

Start with XmlReporter::assertionEnded and inspect how its switch handles each ResultWas type. Check the XML reporter tests for ExpressionFailed output, then verify that the failure message and actual call sequence appear in JetBrains Rider. The issue provides the missing case and the expected result.

Written by the indexing model from the issue text.

Description

When fakeit is used to test for a specific sequence of calls that is not satisfied, the error message shown in Jetbrains Rider only shows the expected sequence, not the actual sequence.

I tracked it down to a switch statement in XmlReporter::assertionEnded. It appears to be missing a case for ResultWas::ExpressionFailed.

I added the missing case (showing some of the surrounding code):

        m_xml.scopedElement( "Expanded" )
            .writeText( result.getExpandedExpression() );
    }

    // And... Print a result applicable to each result type.
    switch( result.getResultType() ) {
        case ResultWas::ExpressionFailed:
            m_xml.startElement( "ExpressionFailed" );
            writeSourceInfo( result.getSourceInfo() );
            m_xml.writeText( result.getMessage() );
            m_xml.endElement();
            break;
        case ResultWas::ThrewException:
            m_xml.startElement( "Exception" );
            writeSourceInfo( result.getSourceInfo() );

and now I correctly see the failure message reported by fakeit in result.getMessage().

Dominant language
C++
Stars
21.6k
Forks
3.4k
Avg merge
3d 12h
Merged PRs (30d)
5

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from catchorg/Catch2

All issues in catchorg/Catch2

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.