test: normalize project reference paths across platforms
This commit is contained in:
1 parent
faf1203f0a
commit
ce3ba51c02
1 file changed
+4
-1
@@ -36,10 +36,13 @@ public sealed class ArchitectureTests
|
|||||||
Path.GetFileNameWithoutExtension(path),
|
Path.GetFileNameWithoutExtension(path),
|
||||||
path,
|
path,
|
||||||
Path.GetDirectoryName(path)!,
|
Path.GetDirectoryName(path)!,
|
||||||
[.. items.Where(e => e.Name == "ProjectReference").Select(e => Path.GetFileNameWithoutExtension((string?)e.Attribute("Include") ?? ""))],
|
[.. items.Where(e => e.Name == "ProjectReference").Select(e => Path.GetFileNameWithoutExtension(NormalizePath((string?)e.Attribute("Include") ?? "")))],
|
||||||
[.. items.Where(e => e.Name == "PackageReference").Select(e => (string?)e.Attribute("Include") ?? "")]);
|
[.. items.Where(e => e.Name == "PackageReference").Select(e => (string?)e.Attribute("Include") ?? "")]);
|
||||||
})];
|
})];
|
||||||
|
|
||||||
|
private static string NormalizePath(string path) =>
|
||||||
|
path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar);
|
||||||
|
|
||||||
private static bool IsTest(Project p) => p.Path.Contains(Path.DirectorySeparatorChar + "tests" + Path.DirectorySeparatorChar, StringComparison.Ordinal);
|
private static bool IsTest(Project p) => p.Path.Contains(Path.DirectorySeparatorChar + "tests" + Path.DirectorySeparatorChar, StringComparison.Ordinal);
|
||||||
|
|
||||||
private static bool IsFleet(Project p) => p.Name.StartsWith("Fleet.", StringComparison.Ordinal) && !IsTest(p);
|
private static bool IsFleet(Project p) => p.Name.StartsWith("Fleet.", StringComparison.Ordinal) && !IsTest(p);
|
||||||
|
|||||||
Reference in new issue
Block a user