Skip to content

Conversation

@dennisdoomen
Copy link
Member

@dennisdoomen dennisdoomen commented Sep 28, 2025

This PR fixes a bug in JSON assertions where the library wasn't properly handling certain numeric types during comparisons. The core issue was that the JSON conversion logic only checked for int and double values, but missed other important numeric types like unsigned integers (uint, ulong), signed long integers (), and floats (float). long

The fix adds support for these missing numeric types by extending the conversion step to handle uint, , ulong, and float values. Additionally, it introduces a new IsNumeric() helper method that properly identifies all numeric JSON values by checking for , ulong, or double types. long``long

Thanks to @jnyrup for the discovery.

@coveralls
Copy link

coveralls commented Sep 28, 2025

Pull Request Test Coverage Report for Build 18187186552

Details

  • 20 of 20 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.009%) to 97.148%

Totals Coverage Status
Change from base Build 18072834336: -0.009%
Covered Lines: 12767
Relevant Lines: 12985

💛 - Coveralls

@github-actions
Copy link

github-actions bot commented Sep 28, 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 fix-numeric-detection branch from 965afe7 to bf23e22 Compare October 1, 2025 19:15
@dennisdoomen dennisdoomen requested a review from jnyrup October 1, 2025 19:15
Copy link
Member

@jnyrup jnyrup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few small int32 -> numeric value corrections

@dennisdoomen dennisdoomen force-pushed the fix-numeric-detection branch from bf23e22 to cc443c0 Compare October 2, 2025 07:17
@dennisdoomen dennisdoomen force-pushed the fix-numeric-detection branch from cc443c0 to 3ffeed2 Compare October 2, 2025 08:07
@dennisdoomen dennisdoomen merged commit 3a6f807 into fluentassertions:hotfix/8.7.1 Oct 2, 2025
6 checks passed
@dennisdoomen dennisdoomen deleted the fix-numeric-detection branch October 2, 2025 08:35
This was referenced Jan 7, 2026
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