Skip to content

Commit

Permalink
Fix FindOnPathSucceeds failing on some Linux flavors (#6055)
Browse files Browse the repository at this point in the history
Fixes #4781, #3580.
  • Loading branch information
tmds committed Feb 4, 2021
1 parent 05b750b commit e8016bb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Utilities.UnitTests/ToolTask_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -679,22 +679,22 @@ public void ToolPathIsFoundWhenDirectoryExistsWithNameOfTool()
[Fact]
public void FindOnPathSucceeds()
{
string expectedCmdPath;
string[] expectedCmdPath;
string shellName;
if (NativeMethodsShared.IsWindows)
{
expectedCmdPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "cmd.exe");
expectedCmdPath = new[] { Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "cmd.exe") };
shellName = "cmd.exe";
}
else
{
expectedCmdPath = "/bin/sh";
expectedCmdPath = new[] { "/bin/sh", "/usr/bin/sh" };
shellName = "sh";
}
string cmdPath = ToolTask.FindOnPath(shellName);
cmdPath.ShouldBe(expectedCmdPath, StringCompareShould.IgnoreCase);
cmdPath.ShouldBeOneOf(expectedCmdPath);
}
/// <summary>
Expand Down

0 comments on commit e8016bb

Please sign in to comment.