Skip to content

Core generator snapshot tests emit nullable and constant-assertion warnings #7428

Closed

Description

@thomhurst

Summary

Building the core source generator snapshot tests emits a nullable dereference warning and an assertion-on-constant warning from the test code. These diagnostics add noise to routine test validation; the test project should build without them.

Reproduction

At 7c87a5e, on macOS arm64 with .NET SDK 10.0.403, run:

dotnet test --project tests/TUnit.Core.SourceGenerator.Tests --framework net10.0

Expected and actual

Expected: no warnings from these test sources.

Actual: NuGetDownloader.cs:35 emits CS8602 (possible null dereference), and AssemblyNamesWithDashesTests.cs:23 emits TUnitAssertions0005 (Assert.That(...) should not use a constant value). Both files have the same relevant code on main at d8badac. Other build warnings are tracked separately in #7410, #7412 and #7419.

Please correct these two test-code diagnostics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low: cleanup, minor enhancement, or rare edge casebugSomething isn't workingin-progressWork is in progress

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions