Skip to content

fix: ensure isFailed matches actual error count in Summary#395

Open
assassinaj602 wants to merge 2 commits into
google:masterfrom
assassinaj602:fix-summary-error-count
Open

fix: ensure isFailed matches actual error count in Summary#395
assassinaj602 wants to merge 2 commits into
google:masterfrom
assassinaj602:fix-summary-error-count

Conversation

@assassinaj602

Copy link
Copy Markdown

Description

Fixes issue where dartdoc_test prints "FAILED: 0 issues found" when there are errors but none have commentSpan.

The Problem

The Summary class used different logic for isFailed and errors count:

  • isFailed counted ALL errors
  • errors counted only errors with commentSpan

This caused mismatched output when errors existed without commentSpan.

What I Changed

  • Updated Summary.from() in lib/src/logger.dart to count all errors consistently
  • isFailed now matches errors.length > 0

Testing

  • Errors with commentSpan show correct count
  • Errors without commentSpan show correct count
  • No errors show "PASSED: No issues found!"
  • All existing tests pass

Closes #275

The Summary class was counting errors with commentSpan differently from
the isFailed check, causing 'FAILED: 0 issues found' when errors existed
but without commentSpan.

Now both isFailed and errors count use the same consistent logic.

Fixes google#275
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.

dartdoc_test indicates a failure even on success

1 participant