Skip to content

Commit 2eec6c0

Browse files
committed
fix: update path handling in McpResourcesTests for cross-platform compatibility
1 parent bcd4c66 commit 2eec6c0

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

tests/ProjGraph.Tests.Integration.Mcp/McpResourcesTests.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,9 @@ public async Task Cache_ListResources_ShouldReturnCorrectAllProperties()
188188
var cache = new DiagramResourceCache();
189189
var before = DateTimeOffset.UtcNow;
190190

191-
await cache.StoreAsync("erd", @"D:\Data\MyContext.cs", "text/plain",
191+
// Use a forward-slash path so Path.GetFileName behaves consistently on Linux and Windows
192+
const string path = "/data/MyContext.cs";
193+
await cache.StoreAsync("erd", path, "text/plain",
192194
"erDiagram\n A ||--o{ B : has", "ERD for MyContext", null, CancellationToken.None);
193195

194196
var after = DateTimeOffset.UtcNow;
@@ -197,9 +199,9 @@ await cache.StoreAsync("erd", @"D:\Data\MyContext.cs", "text/plain",
197199
resources.Should().ContainSingle();
198200
var r = resources[0];
199201

200-
r.Uri.Should().Be($"projgraph://diagrams/erd/{Uri.EscapeDataString(@"D:\Data\MyContext.cs")}");
202+
r.Uri.Should().Be($"projgraph://diagrams/erd/{Uri.EscapeDataString(path)}");
201203
r.AnalysisType.Should().Be("erd");
202-
r.SourcePath.Should().Be(@"D:\Data\MyContext.cs");
204+
r.SourcePath.Should().Be(path);
203205
r.MimeType.Should().Be("text/plain");
204206
r.Description.Should().Be("ERD for MyContext");
205207
r.Name.Should().Be("erd \u2014 MyContext.cs");

0 commit comments

Comments
 (0)