Skip to content

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

Closed

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);

Activity

  1. added this to the 5.0 milestone on Feb 15, 2020
  2. added
    untriaged
    on Feb 15, 2020
  3. removed
    untriaged
    on Feb 15, 2020
  4. added
    help wanted
    on Apr 7, 2020
  5. modified the milestones: 5.0.0, Future on Jul 7, 2020
  6. added a commit that references this issue on Nov 17, 2020
    f856716
  7. added a commit that references this issue on Nov 17, 2020
    9d60485
  8. ghost locked as resolved and limited conversation to collaborators on Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.Text.Jsonhelp wantedtest-enhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions