Skip to content

Commit 3dee42b

Browse files
committed
Fix Windows CI: Escape backslashes in JSON path interpolation
Fixes Windows CI failure where file paths with backslashes in JSON strings were not properly escaped, causing JSON parsing errors. Changes: - Escape backslashes in outputPath interpolation for integration tests - Use .Replace('\', '\\') to convert single backslashes to double backslashes - Fixes both CliWorkflow tests that create JSON config files with paths This resolves the System.Text.Json.JsonException on Windows CI builds while maintaining compatibility with Unix-style paths on macOS/Linux.
1 parent 4de41d3 commit 3dee42b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/DotNetApiDiff.Tests/Integration/CliWorkflowTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ public void CliWorkflow_ConfigurationJsonEnumParsing_ShouldParseOutputFormatCorr
515515
"treatSignatureChangeAsBreaking": true
516516
},
517517
"outputFormat": "Html",
518-
"outputPath": "{{outputFile}}",
518+
"outputPath": "{{outputFile.Replace("\\", "\\\\")}}",
519519
"failOnBreakingChanges": false
520520
}
521521
""";
@@ -597,7 +597,7 @@ public void CliWorkflow_CommandLineOverridesConfig_ShouldUseExplicitCommandLineF
597597
"treatSignatureChangeAsBreaking": true
598598
},
599599
"outputFormat": "Html",
600-
"outputPath": "{{outputFile}}",
600+
"outputPath": "{{outputFile.Replace("\\", "\\\\")}}",
601601
"failOnBreakingChanges": false
602602
}
603603
""";

0 commit comments

Comments
 (0)