Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,11 @@ public void GetManifestResourceStream_WithType_ReturnsStream()
// May be null if resource doesn't exist
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))]
public void GetModule_ReturnsModule()
{
string moduleName = _customAssembly.ManifestModule.Name;
if (PlatformDetection.HasAssemblyFiles)
{
Module module = _customAssembly.GetModule(moduleName);
Assert.NotNull(module);
}
else
{
// On native AOT, Module.Name returns "<Unknown>" and GetModule with that name returns null
Assert.Equal("<Unknown>", moduleName);
}
Module module = _customAssembly.GetModule(_customAssembly.ManifestModule.Name);
Assert.NotNull(module);
Comment on lines +101 to +105
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ConditionalFact(...HasAssemblyFiles)] will skip this test on browser-wasm because HasAssemblyFiles is based on Assembly.Location being non-empty (which is empty on browser). That avoids the failure by not running the test, but it doesn’t implement the PR’s stated intent of keeping the test running on wasm and only special-casing NativeAOT. Consider making this a regular [Fact] and branching on PlatformDetection.IsNativeAot (assert ManifestModule.Name is "" / GetModule returns null), otherwise call GetModule(moduleName) and assert non-null so wasm is covered.

Copilot uses AI. Check for mistakes.
}

[Fact]
Expand Down