Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
used string.replace instead of regex
  • Loading branch information
Stefan Pahontu committed Jul 21, 2022
commit f12f56ad5a9c5da3e5ca6a7c01f950f587dd95b8
5 changes: 2 additions & 3 deletions src/tests/BuildWasmApps/Wasm.Build.Tests/WasmTemplateTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,11 @@ private void updateProgramCS() {

for (int i = 0; i < args.Length; i ++)
Console.WriteLine ($"args[{i}] = {args[i]}");

""";
var path = Path.Combine(_projectDir!, "Program.cs");
string text = File.ReadAllText(path);
string newText = Regex.Replace(text, "Console\\.WriteLine\\(\\\"Hello, Console!\\\"\\);", programText);
File.WriteAllText(path, newText);
text = text.Replace(@"Console.WriteLine(""Hello, Console!"");", programText);
File.WriteAllText(path, text);
}

[Theory]
Expand Down