fix(api): round-trip repeat times attribute - #285
Merged
Merged
Conversation
The barline reader recorded only a bool for a repeat and dropped the times count; the writer never emitted it. Add BarlineData::repeatTimes (0 = unspecified, mirroring endingNumber), read it from the source repeat, and emit it when set. Harvest ly45a and ly45c into the roundtrip baseline.
Coverage reportCore-dev coverage
|
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 77.8% | 28487 / 36624 |
| Functions | 74.3% | 6349 / 8550 |
| Branches | 50.6% | 22632 / 44725 |
API coverage src/private/mx/{api,impl,utility}/
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 78.4% | 6029 / 7687 |
| Functions | 63.7% | 2045 / 3209 |
| Branches | 47.6% | 5112 / 10733 |
Core HTML report | API HTML report
Commit 9fe0f61b3e5ebfbdc1c2ead4c434a41b0e193df9.
gen-quality
|
rpatters1
added a commit
to rpatters1/mx
that referenced
this pull request
Jul 2, 2026
* write-lyricdata: commit test as well Add write side for lyrics data. test: add rpatters1 composite time-sig sample (webern#287) fix(api): round-trip repeat times attribute (webern#285)
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.
Summary
A
<repeat>lost itstimescount on api round-trip.BarlineDatacarried only abool repeat, so the barline reader discarded the count and the writer never emitted it.Added
BarlineData::repeatTimes(an int where 0 means not specified, mirroring theexisting
endingNumberconvention on the same struct). The barline reader now readsrepeat()->times(), and the barline writer emitstimeswhen the count is set. Thecommon no-times case stays at 0 and nothing is written.
Testing
rightBarlineRepeatTimesMeasureWriter test: a backward repeat withrepeatTimes = 5emits a<repeat>carryingtimes="5"lysuite/ly45a_SimpleRepeat.xml and lysuite/ly45c_RepeatMultipleTimes.xml now
round-trip and are pinned in the baseline.
References