Skip to content

Commit bb7901e

Browse files
Replace manual platform checks with SkipOnPlatform attributes in Unix-specific tests
Co-authored-by: YuliiaKovalova <95473390+YuliiaKovalova@users.noreply.github.com>
1 parent 5aab144 commit bb7901e

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

src/Build.UnitTests/Construction/SolutionFile_OldParser_Tests.cs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2489,13 +2489,9 @@ public void ParseSolutionWithComments()
24892489
/// file contains project paths with backslashes.
24902490
/// </summary>
24912491
[Fact]
2492+
[SkipOnPlatform(TestPlatforms.Windows, "Unix-specific test")]
24922493
public void AbsolutePathShouldUseForwardSlashesOnUnix()
24932494
{
2494-
// Skip test if running on Windows
2495-
if (NativeMethodsShared.IsWindows)
2496-
{
2497-
return;
2498-
}
24992495

25002496
string solutionFileContents =
25012497
@"
@@ -2531,13 +2527,9 @@ public void AbsolutePathShouldUseForwardSlashesOnUnix()
25312527
/// and bypass normalization, leading to backslashes in AbsolutePath on Unix.
25322528
/// </summary>
25332529
[Fact]
2530+
[SkipOnPlatform(TestPlatforms.Windows, "Unix-specific test")]
25342531
public void AbsolutePathShouldHandleUriLikeRelativePathsOnUnix()
25352532
{
2536-
// Skip test if running on Windows
2537-
if (NativeMethodsShared.IsWindows)
2538-
{
2539-
return;
2540-
}
25412533

25422534
// Test with a path that might be interpreted as a URI
25432535
string solutionFileContents =
@@ -2568,13 +2560,9 @@ public void AbsolutePathShouldHandleUriLikeRelativePathsOnUnix()
25682560
/// leave backslashes in the AbsolutePath on Unix systems.
25692561
/// </summary>
25702562
[Fact]
2563+
[SkipOnPlatform(TestPlatforms.Windows, "Unix-specific test")]
25712564
public void AbsolutePathFixFilePathIntegrationTest()
25722565
{
2573-
// Skip test if running on Windows
2574-
if (NativeMethodsShared.IsWindows)
2575-
{
2576-
return;
2577-
}
25782566

25792567
string solutionFileContents =
25802568
@"

0 commit comments

Comments
 (0)