Skip to content

Commit

Permalink
Enable JSON validation in string literal
Browse files Browse the repository at this point in the history
I've also taken this opportunity to the new raw string literal syntax
[1] so that all the double quotes in the string no longer need to be
escaped.

[1] dotnet/csharplang#4304
  • Loading branch information
smfeest committed Aug 6, 2023
1 parent e328c44 commit 76da519
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ public sealed class AssetManifestReaderTests
[Fact]
public void ReturnsManifestDeserializedFromJson()
{
var bytes = Encoding.UTF8.GetBytes("{\"alpha\":\"beta\",\"gamma\":\"delta\"}");
var bytes = Encoding.UTF8.GetBytes(
/*lang=json,strict*/ """{"alpha": "beta", "gamma":"delta"}""");

using var stream = new MemoryStream(bytes);

Expand Down

0 comments on commit 76da519

Please sign in to comment.