Repository navigation
feat: add Scanner.LastError() - #129
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #129 +/- ##
==========================================
+ Coverage 80.95% 81.14% +0.18%
==========================================
Files 28 28
Lines 4468 4470 +2
==========================================
+ Hits 3617 3627 +10
+ Misses 720 716 -4
+ Partials 131 127 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
lastError only ever holds the scanner's read error, set by HasNext when
the source could not be read; the previous wording ("while parsing the
game") overstated it. The example now nests with four spaces, like every
other example in this file.
Adds tests covering both a successful scan and a read failure.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scanner.HasNext()can encounter an error which it saves toScanner.lastError, but there is no way for the user to see what the error was, becauselastErroris not exposed.This PR adds method
Scanner.HasNext()which returns thelastError.Rationale: Encountered an error while trying to parse the PGN file for the longest possible chess game.