Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Add interleaved comments to JsonSerializer tests#37712

Merged
ahsonkhan merged 1 commit intodotnet:masterfrom
watfordgnf:add-interleaved-json-comments-test
May 17, 2019
Merged

Add interleaved comments to JsonSerializer tests#37712
ahsonkhan merged 1 commit intodotnet:masterfrom
watfordgnf:add-interleaved-json-comments-test

Conversation

@watfordgnf
Copy link
Copy Markdown
Contributor

Per this PR comment #37549 (comment) this adds tests for interleaved comments within JSON objects and arrays.

cc @ahsonkhan

@watfordgnf
Copy link
Copy Markdown
Contributor Author

watfordgnf commented May 16, 2019

Test failures on corefx-ci (Windows x86) appear to be unrelated (System.Drawing.Tests).

@ahsonkhan ahsonkhan added area-System.Text.Json test enhancement Improvements of test source code labels May 16, 2019
@ahsonkhan ahsonkhan added this to the 3.0 milestone May 16, 2019
Copy link
Copy Markdown

@ahsonkhan ahsonkhan left a comment

Choose a reason for hiding this comment

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

LGTM

var options = new JsonSerializerOptions();
options.ReadCommentHandling = JsonCommentHandling.Skip;

int[][] i = JsonSerializer.Parse<int[][]>(Encoding.UTF8.GetBytes("[[1,2] // Inline [\n,[3, /* Multi\n]] Line*/4]]"), options);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

// Inline [\n

Nice comment :)

@ahsonkhan ahsonkhan merged commit 18ddda0 into dotnet:master May 17, 2019
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Text.Json test enhancement Improvements of test source code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants