Skip to content

Fix: scan multiple tagless PGN games - #134

Open
tiagoGottardo wants to merge 2 commits into
CorentinGS:mainfrom
tiagoGottardo:fix/tagless-pgn-scanning
Open

tiagoGottardo wants to merge 2 commits into
CorentinGS:mainfrom
tiagoGottardo:fix/tagless-pgn-scanning

Conversation

@tiagoGottardo

Copy link
Copy Markdown
Contributor

Problem

PGN files exported from Lichess without tags can contain multiple games. The scanner treats consecutive tagless games as one, causing ParseNext to fail with a parser error.

The minimal reproduction from issue #130 is:

1. e4 e6

1. e4 e5

Fix

The scanner now detects a new tagless game starting with 1. after a blank line or after the previous game's result marker. Blank-line detection is limited to tagless games so tagged PGNs are not split between headers and movetext.

Tests

TestScannerMultipleTaglessGames covers multiple tagless games with and without result markers.

go test ./... passes.

Closes #130

@codecov

codecov Bot commented Oct 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.35294% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.12%. Comparing base (c5e0038) to head (6eee6d9).

Files with missing lines Patch % Lines
scanner.go 82.35% 4 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #134   +/-   ##
=======================================
  Coverage   81.12%   81.12%           
=======================================
  Files          28       28           
  Lines        4477     4509   +32     
=======================================
+ Hits         3632     3658   +26     
- Misses        716      720    +4     
- Partials      129      131    +2     

☔ 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.

Unable to parse tagless PGN files with more than one game per file.

1 participant