Skip to content

Commit 652621a

Browse files
committed
Fix broken unit and package tests
1 parent dbe2d5f commit 652621a

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

src/NUnitEngine/nunit.engine.core/DotNetHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ private static IEnumerable<RuntimeInfo> GetAllRuntimes(bool x86)
8484
foreach (string line in DotnetCommand("--list-runtimes", x86: x86))
8585
{
8686
string[] parts = line.Trim().Split([' '], 3);
87-
yield return new RuntimeInfo(parts[0], parts[1] + ".0", parts[2].Trim(['[', ']']));
87+
yield return new RuntimeInfo(parts[0], parts[1], parts[2].Trim(['[', ']']));
8888
}
8989
}
9090

src/NUnitEngine/nunit.engine.core/Internal/PathUtils.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,10 @@ public static bool SamePathOrUnder( string path1, string path2 )
144144

145145
// if lengths are the same, check for equality
146146
if ( length1 == length2 )
147-
return string.Compare( path1, path2, OS.IsWindows ) == 0;
147+
return string.Compare( path1, path2, RunningOnWindows ) == 0;
148148

149149
// path 2 is longer than path 1: see if initial parts match
150-
if ( string.Compare( path1, path2.Substring( 0, length1 ), OS.IsWindows) != 0 )
150+
if ( string.Compare( path1, path2.Substring( 0, length1 ), RunningOnWindows) != 0 )
151151
return false;
152152

153153
// must match through or up to a directory separator boundary
@@ -174,11 +174,13 @@ public static string Combine(string path1, params string[] morePaths)
174174
/// <exception cref="ArgumentNullException"><paramref name="path"/></exception>
175175
public static bool IsFullyQualifiedPath(string path )
176176
{
177-
return OS.IsWindows
177+
return RunningOnWindows
178178
? IsFullyQualifiedWindowsPath(path)
179179
: IsFullyQualifiedUnixPath(path);
180180
}
181181

182+
private static bool RunningOnWindows => DirectorySeparatorChar == '\\';
183+
182184
/// <summary>
183185
/// Returns a value that indicates whether the specified file path is fully qualified or not on Windows operating systems.
184186
/// </summary>
@@ -275,7 +277,7 @@ private static string[] SplitPath(string path)
275277

276278
private static bool PathsEqual(string path1, string path2)
277279
{
278-
if (OS.IsWindows)
280+
if (RunningOnWindows)
279281
return path1.ToLower().Equals(path2.ToLower());
280282
else
281283
return path1.Equals(path2);

src/NUnitEngine/nunit.engine/Services/AgentProcess.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public AgentProcess(TestAgency agency, TestPackage package, Guid agentId)
6969

7070
if (runAsX86)
7171
{
72-
if (OS.IsWindows)
72+
if (!OS.IsWindows)
7373
throw new Exception("Running .NET Core as X86 is currently only supported on Windows");
7474

7575
if (!File.Exists(StartInfo.FileName))

0 commit comments

Comments
 (0)