Skip to content

Conversation

@dennisdoomen
Copy link
Member

Especially in BeEquivalentTo calls we often pass the path from the root of the graph to the position in the graph that is being compared as a string into the FailWith calls. Since it's (apparently) possible that dictionary keys contain { and/or }, this caused a crash in the MessageBuilder while building the final failure message. We couldn't use normal string.Format placeholders like {0}, {1} and such because that caused the Formatter class to enclose strings with quotes. We solved that by introducing a special internal extension method AsNonFormattable that wraps the object to be formatted in such a way that the Formatter will not try to apply any formatting.

This solves #2704

@dennisdoomen dennisdoomen marked this pull request as draft February 21, 2025 07:47
@github-actions
Copy link

github-actions bot commented Feb 21, 2025

Qodana for .NET

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

@dennisdoomen dennisdoomen force-pushed the formatting-crash branch 2 times, most recently from 0cf2157 to 6089cb3 Compare February 21, 2025 10:44
@dennisdoomen dennisdoomen marked this pull request as ready for review February 21, 2025 10:44
@dennisdoomen dennisdoomen added this to the 8.1.1 milestone Feb 21, 2025
@coveralls
Copy link

coveralls commented Feb 21, 2025

Pull Request Test Coverage Report for Build 13458568200

Details

  • 25 of 25 (100.0%) changed or added relevant lines in 9 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.008%) to 97.43%

Totals Coverage Status
Change from base Build 13444953341: 0.008%
Covered Lines: 12325
Relevant Lines: 12509

💛 - Coveralls

@dennisdoomen dennisdoomen requested a review from jnyrup February 21, 2025 11:06
@dennisdoomen dennisdoomen merged commit 3405157 into fluentassertions:main Feb 21, 2025
8 checks passed
@dennisdoomen dennisdoomen deleted the formatting-crash branch February 21, 2025 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants