Core generator snapshot tests emit nullable and constant-assertion warnings
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start with NuGetDownloader.cs around line 35, where CS8602 reports a possible null dereference, and with AssemblyNamesWithDashesTests.cs around line 23, where TUnitAssertions0005 flags a constant passed to Assert.That(...). Build with dotnet test --project tests/TUnit.Core.SourceGenerator.Tests --framework net10.0 to see both warnings. Done means that build no longer reports either diagnostic, and the tests still pass.
Written by the indexing model from the issue text.
Description
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 7c87a5ec3ca3df50d75834424c56e651d78efade, 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 d8badacb13. Other build warnings are tracked separately in #7410, #7412 and #7419.
Please correct these two test-code diagnostics.
- Dominant language
- C#
- Stars
- 4k
- Forks
- 139
- Avg merge
- 9h 6m
- Merged PRs (30d)
- 282
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from thomhurst/TUnit
-
bug P3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug P3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
documentation P3
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
thomhurst/TUnit#7444 · 1 comment ·
Maintainers usually reply within 1 day
-
bug P2
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug P3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
Similar issues
-
VB -> C#
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
icsharpcode/CodeConverter#1301 ·
Maintainers usually reply within 3 days
-
PettingZoo wrappers send only the first action component to every action dimensionPossibly taken @RaphaelFakhri claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Unity-Technologies/ml-agents#6341 ·
Maintainers usually reply within 1 day
-
Area: World-Readiness
Difficulty 1/5 Under an hour Newbie friendliness 90/100
microsoft/calculator#2522 ·
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Sonarr/Sonarr#9274 · 1 comment ·
Maintainers usually reply within 2 days
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 64/100