Skip to content

C# 14: add audit tests (lambda parameter modifiers, compound assignment operators, null-conditional assignment, nameof unbound generics) - #4151

Merged
AArnott merged 5 commits into
masterfrom
csharp14-audit-tests
Oct 8, 2026
Merged

AArnott merged 5 commits into
masterfrom
csharp14-audit-tests

Conversation

@AArnott

@AArnott AArnott commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Part of #4046 (C# 14 audit).

Tests-only.

Checklist item Coverage Source
#4027 simple lambda parameters with modifiers ((text, out result) => …) SA1000, SA1001, SA1008 @bjornhellander 3e0f3f6a3 (bjornhellander/NewStyleCopAnalyzers#31)
#4030 user-defined compound assignment operators (public void operator +=(…)) SA1611, SA1201, SA1204, SA1206, SA1110, SA1000, SA1008, SA1009 @bjornhellander 992dcc851 (bjornhellander/NewStyleCopAnalyzers#33)
#4024 null-conditional assignment (c?.Value = 1, c?.Next?.Value += 2) SA1019 (spacing around ?. on the left of an assignment, with fix) me
#4025 unbound generic types in nameof (nameof(List<>), nameof(Dictionary<,>)) SA1014, SA1015 (with fix) me

Björn's commits are cherry-picked with -x and his authorship kept. The tests were merged into the existing upstream test classes and use ConfigureAwait(false) and [WorkItem]. The SA1201 test uses upstream's message arguments ("An operator", "a method").

No behavior change.

Audit notes, things I checked that need no change:

Locally (Linux): all new tests pass on C# 14 and 15. The only failures in these test classes are the known CRLF code-fix failures (SA1201 extension-block tests that already fail on master).

bjornhellander and others added 3 commits October 7, 2026 22:50
From bjornhellander/NewStyleCopAnalyzers#31.

Adapted while cherry-picking: tests were merged into the existing upstream test classes and use ConfigureAwait(false) and WorkItem(4027).

(cherry picked from commit 3e0f3f6a3807c56af35d3ec24d86c2b3023b0b3b)
From bjornhellander/NewStyleCopAnalyzers#33.

Adapted while cherry-picking: tests were merged into the existing upstream test classes and use ConfigureAwait(false) and WorkItem(4030). The SA1201 test uses the upstream message arguments
("An operator", "a method").

(cherry picked from commit 992dcc851ad67434f8c15fb27c79003003692f4f)
…ypes in nameof

SA1019 checks the spacing of '?.' on the left side of an assignment (#4024),
and SA1014/SA1015 check the brackets of unbound generic types such as
nameof(Dictionary<,>) (#4025).
@codecov

codecov Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.42%. Comparing base (f26d21b) to head (2bba88a).
⚠️ Report is 14 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #4151    +/-   ##
========================================
  Coverage   97.41%   97.42%            
========================================
  Files        1118     1127     +9     
  Lines      124962   125408   +446     
  Branches     4203     4203            
========================================
+ Hits       121734   122180   +446     
  Misses       2116     2116            
  Partials     1112     1112            
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AArnott
AArnott marked this pull request as ready for review October 8, 2026 05:22
# Conflicts:
#	StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp14/SpacingRules/SA1000CSharp14UnitTests.cs
# Conflicts:
#	StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp14/ReadabilityRules/SA1110CSharp14UnitTests.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants