Skip to content

Commit

Permalink
:(
Browse files Browse the repository at this point in the history
  • Loading branch information
tmat committed Nov 18, 2024
1 parent 1b5a49d commit c4bc507
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/Compilers/CSharp/Test/CommandLine/CommandLineTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4798,7 +4798,11 @@ public void UnableWriteOutput_OutputFileLocked()

var pattern = @"error CS2012: Cannot open '(?<path>.*)' for writing -- (?<message>.*); file may be locked by '(?<app>.*)' \((?<pid>.*)\)";
var match = Regex.Match(output, pattern);
Assert.True(match.Success, $"Expected:{Environment.NewLine}{pattern}{Environment.NewLine}Actual:{Environment.NewLine}{output}");
if (!match.Success)
{
Assert.Fail($"Expected:{Environment.NewLine}{pattern}{Environment.NewLine}Actual:{Environment.NewLine}{output}");
}

Assert.Equal(filePath, match.Groups["path"].Value);
Assert.Contains("testhost", match.Groups["app"].Value);
Assert.Equal(currentProcess.Id, int.Parse(match.Groups["pid"].Value));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5061,7 +5061,10 @@ End Class

Dim pattern = "vbc : error BC2012: can't open '(?<path>.*)' for writing: (?<message>.*); file may be locked by '(?<app>.*)' \((?<pid>.*)\)"
Dim match = Regex.Match(output, pattern)
Assert.True(match.Success, $"Expected:{Environment.NewLine}{pattern}{Environment.NewLine}Actual:{Environment.NewLine}{output}")
If Not match.Success Then
Assert.Fail($"Expected:{Environment.NewLine}{pattern}{Environment.NewLine}Actual:{Environment.NewLine}{output}")
End If

Assert.Equal(filePath, match.Groups("path").Value)
Assert.Contains("testhost", match.Groups("app").Value)
Assert.Equal(currentProcess.Id, Integer.Parse(match.Groups("pid").Value))
Expand Down

0 comments on commit c4bc507

Please sign in to comment.