2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2026-06-23 18:38:41 +00:00

FetchTypeDef

This commit is contained in:
2026-06-16 16:07:57 +03:00
parent 147572a138
commit 3d0f97ade0
5 changed files with 101 additions and 23 deletions
+15
View File
@@ -18,6 +18,14 @@ public class FetchCycleDetectionTests
return g;
}
static Dictionary<ulong, HashSet<ulong>> Graph64(params (ulong parent, ulong[] children)[] edges)
{
var g = new Dictionary<ulong, HashSet<ulong>>();
foreach (var (parent, children) in edges)
g[parent] = new HashSet<ulong>(children);
return g;
}
[Fact]
public void AppFacingFetch_NoChain_NeverCycles()
{
@@ -83,4 +91,11 @@ public class FetchCycleDetectionTests
var g = Graph((2u, new uint[] { 3 }), (3u, new uint[] { 2 }));
Assert.False(EpConnection.HasWaitForCycle(2, new uint[] { 1 }, g));
}
[Fact]
public void TypeDefIds_UseSameCycleDetection()
{
var g = Graph64((2ul, new ulong[] { 3 }), (3ul, new ulong[] { 1 }));
Assert.True(EpConnection.HasWaitForCycle(2ul, new ulong[] { 1 }, g));
}
}