Skip to content

Commit

Permalink
fix: improve JSON serialization for test output
Browse files Browse the repository at this point in the history
- Added UnsafeRelaxedJsonEscaping to JsonSerializerOptions
- Ensures special characters are properly handled in test output
  • Loading branch information
qwqcode committed Sep 24, 2024
1 parent 8f3485f commit 248bf00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion SubRenamer.Tests/MatcherTests/TopLevelTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void TestCasesFromJson(string name, List<MatchItem> input, List<MatchItem
{
var actual = Execute(input);

var jsonOpts = new JsonSerializerOptions { WriteIndented = true };
var jsonOpts = new JsonSerializerOptions { WriteIndented = true, Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping };
TestContext.Progress.WriteLine("{1}\n\n \ud83c\udf1f Matcher Test Case: {0}\n\n{1}", name, new string('=', 50));
TestContext.Progress.WriteLine("{2}\n {0}\n{2}\n{1}", "Input", JsonSerializer.Serialize(input, jsonOpts),
new string('-', 50));
Expand Down

0 comments on commit 248bf00

Please sign in to comment.