Skip to content

Update tests to reflect the different rounding/e-notation when writing numbers between S.T.J and Newtonsoft.Json #32350

@ahsonkhan

Description

@ahsonkhan

Add string comparison asserts for writer tests with various floats/doubles with accurate expected strings. Comparing to the strings from Newtonsoft.Json won't work for all cases, and we should split up those special cases into their own tests with hard-coded strings.

Writing trailing zeros for float/double/decimal number differ. For example:

  • "0" vs "0.0"
  • "message": -1588732675085190 vs. "message": -1588732675085190.0

// TODO: The output doesn't match what JSON.NET does (different rounding/e-notation).
// JsonTestHelper.AssertContents(expectedStr, output);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions