Skip to content

Handle duplicate PGN tags#24

Merged
NSStudent merged 1 commit into
developfrom
fix/duplicated-tag
May 1, 2026
Merged

Handle duplicate PGN tags#24
NSStudent merged 1 commit into
developfrom
fix/duplicated-tag

Conversation

@NSStudent

Copy link
Copy Markdown
Owner

Summary

  • Allow PGN tag parsing to accept duplicate tags by keeping the last value for a repeated key.
  • Add a tournament PGN regression case with duplicate FEN tags.

Root Cause

TagParser built its metadata dictionary with Dictionary.init, which traps when the parsed tag list contains duplicate keys. Some tournament PGNs can include two FEN tags, causing parsing to crash before the game is returned.

Validation

  • swift test --filter PGNGameParserTests
  • swift test

@codecov

codecov Bot commented May 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
Sources/FischerCore/PGN/Parsers/TagParser.swift 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

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

@NSStudent NSStudent marked this pull request as ready for review May 1, 2026 17:45
@NSStudent NSStudent merged commit 3e6fba2 into develop May 1, 2026
3 checks passed
@NSStudent NSStudent deleted the fix/duplicated-tag branch May 1, 2026 17:46
NSStudent added a commit that referenced this pull request May 1, 2026
Handle duplicate PGN tags (#24)
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