Skip to content

style: idiomatic cleanups in matcher/formatter/filter test suites - #420

Merged
twcclegg merged 1 commit into
mainfrom
style/test-large-matcher-suite
Aug 26, 2026
Merged

style: idiomatic cleanups in matcher/formatter/filter test suites#420
twcclegg merged 1 commit into
mainfrom
style/test-large-matcher-suite

Conversation

@twcclegg

Copy link
Copy Markdown
Owner

Summary

Conservative idiomatic-C# pass over TestPhoneNumberMatcher.cs, TestAsYouTypeFormatter.cs, and TestMetadataFilter.cs. These are near line-by-line ports of the upstream Java test suite, so scope was deliberately narrow: only non-assertion helper code was touched, and no assertion logic, expected values, test data, or test method identity was changed.

  • TestPhoneNumberMatcher.cs: == null/!= nullis null/is not null, and a string .Equals()!=, all in the DoTestNumberMatchesForLeniency/DoTestNumberNonMatchesForLeniency helpers (not inside any Assert.* call).
  • TestAsYouTypeFormatter.cs, TestMetadataFilter.cs: reviewed, no safe changes found. TestMetadataFilter.cs has one .Equals(null) call, but it's TestEquals_WhenNull_ReturnsFalse deliberately exercising MetadataFilter.Equals's null-argument behavior — left untouched since that's the point of the test.

Test plan

  • dotnet build csharp/PhoneNumbers.slnx — 0 warnings, 0 errors
  • dotnet test csharp/PhoneNumbers.Test/PhoneNumbers.Test.csproj — 414/414 passing on net8.0 and net10.0 (same count as before)

…r code

Non-assertion helper logic in DoTestNumberMatchesForLeniency/
DoTestNumberNonMatchesForLeniency: == null/!= null -> is null/is not null,
and a string .Equals() -> !=. Assertion contents and test data untouched.
@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.42%. Comparing base (e75ae83) to head (9516f9e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #420   +/-   ##
=======================================
  Coverage   87.42%   87.42%           
=======================================
  Files          41       41           
  Lines        3856     3856           
  Branches      990      990           
=======================================
  Hits         3371     3371           
  Misses        283      283           
  Partials      202      202           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant