Skip to content

Commit

Permalink
Remove ProcessProfileEvaluationInvalidFilename
Browse files Browse the repository at this point in the history
This tested behavior of System.IO that only appled on
.NET Framework and was removed by #10705. Since evaluation
profiling is rarely used, I prefer to just drop the test.
  • Loading branch information
rainersigwald committed Oct 7, 2024
1 parent f55faa3 commit 4fe03ac
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1531,25 +1531,6 @@ public void ProcessInvalidTargetSwitch()
#endif
}

/// <summary>
/// Verifies that when the /profileevaluation switch is used with invalid filenames an error is shown.
/// </summary>
[MemberData(nameof(GetInvalidFilenames))]
[WindowsFullFrameworkOnlyTheory(additionalMessage: ".NET Core 2.1+ no longer validates paths: https://github.com/dotnet/corefx/issues/27779#issuecomment-371253486.")]
public void ProcessProfileEvaluationInvalidFilename(string filename)
{
bool enableProfiler = false;
Should.Throw(
() => MSBuildApp.ProcessProfileEvaluationSwitch(new[] { filename }, new List<ILogger>(), out enableProfiler),
typeof(CommandLineSwitchException));
}

public static IEnumerable<object[]> GetInvalidFilenames()
{
yield return new object[] { $"a_file_with${Path.GetInvalidFileNameChars().First()}invalid_chars" };
yield return new object[] { $"C:\\a_path\\with{Path.GetInvalidPathChars().First()}invalid\\chars" };
}

/// <summary>
/// Verifies that help messages are correctly formed with the right width and leading spaces.
/// </summary>
Expand Down

0 comments on commit 4fe03ac

Please sign in to comment.