Skip to content

Commit 4a19a49

Browse files
committed
Make polling alias test cross-platform (#5124)
1 parent 5d48035 commit 4a19a49

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

tests/CodeIndex.Tests/IndexWatchRunnerTests.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2319,9 +2319,8 @@ public void PollingSnapshot_DirectoryAliasSelectionMatchesDepthFirstScannerOrder
23192319
}
23202320

23212321
var rootDirectories = Directory.EnumerateDirectories(projectRoot).ToArray();
2322-
Assert.True(
2323-
Array.IndexOf(rootDirectories, parentDirectory) < Array.IndexOf(rootDirectories, directAlias),
2324-
"The fixture requires the parent directory to precede the direct alias in enumeration order.");
2322+
var parentPrecedesDirectAlias =
2323+
Array.IndexOf(rootDirectories, parentDirectory) < Array.IndexOf(rootDirectories, directAlias);
23252324

23262325
var nestedPath = Path.Combine(nestedAlias, "tracked.cs");
23272326
var directPath = Path.Combine(directAlias, "tracked.cs");
@@ -2333,8 +2332,8 @@ public void PollingSnapshot_DirectoryAliasSelectionMatchesDepthFirstScannerOrder
23332332
dbPathExplicit: true,
23342333
symlinkPolicy);
23352334

2336-
Assert.Contains(nestedPath, snapshotPaths);
2337-
Assert.DoesNotContain(directPath, snapshotPaths);
2335+
Assert.Contains(parentPrecedesDirectAlias ? nestedPath : directPath, snapshotPaths);
2336+
Assert.DoesNotContain(parentPrecedesDirectAlias ? directPath : nestedPath, snapshotPaths);
23382337
}
23392338
finally
23402339
{

0 commit comments

Comments
 (0)