Skip to content

Commit aef2b37

Browse files
committed
Update WindowsProcessTests.cs
1 parent 397dffd commit aef2b37

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

src/DiffEngine.Tests/WindowsProcessTests.cs

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#if NET5_0_OR_GREATER
2+
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
3+
#endif
14
public class WindowsProcessTests(ITestOutputHelper output) :
25
XunitContextBase(output)
36
{
@@ -7,8 +10,15 @@ public class WindowsProcessTests(ITestOutputHelper output) :
710
[InlineData("\"C:\\diff\\tool.exe\" D:\\path\\to\\source.1.cs D:\\path\\to\\target.2.cs", true)]
811
[InlineData("code.exe --diff file.a.b file.c.d", true)]
912
[InlineData("app.exe path.with.dots path.more.dots", true)]
10-
public void MatchesPattern_WithTwoFilePaths_ReturnsTrue(string commandLine, bool expected) =>
13+
public void MatchesPattern_WithTwoFilePaths_ReturnsTrue(string commandLine, bool expected)
14+
{
15+
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
16+
{
17+
return;
18+
}
19+
1120
Assert.Equal(expected, WindowsProcess.MatchesPattern(commandLine));
21+
}
1222

1323
[Theory]
1424
[InlineData("notepad.exe")]
@@ -18,8 +28,15 @@ public void MatchesPattern_WithTwoFilePaths_ReturnsTrue(string commandLine, bool
1828
[InlineData("")]
1929
[InlineData("singleword")]
2030
[InlineData("app.exe onepath.with.dots")]
21-
public void MatchesPattern_WithoutTwoFilePaths_ReturnsFalse(string commandLine) =>
31+
public void MatchesPattern_WithoutTwoFilePaths_ReturnsFalse(string commandLine)
32+
{
33+
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
34+
{
35+
return;
36+
}
37+
2238
Assert.False(WindowsProcess.MatchesPattern(commandLine));
39+
}
2340

2441
[Fact]
2542
public void FindAll_ReturnsProcessCommands()

0 commit comments

Comments
 (0)