Repository navigation
fix(test): decouple MetadataConfig block-scalar test from shipping copy - #1007
Merged
Merged
Conversation
The #986 marketing copy overhaul dropped "Truly cross-platform" and switched the subtitle to "&", turning 3 assertions in `decodesBlockScalar` red on a clean main even though both the config and the decoder were correct. Because that test hardcoded exact marketing prose, every future copy edit would break it again, and a genuine block-scalar decoder regression could now hide behind the noise. Replace the prose assertions with a fixture the test owns (Fixtures/BlockScalarFixture/), exercising the two block-scalar forms production actually uses (`|-` strip, `|` clip — inventoried across every app-meta.yaml/listing.yaml; no `>` folded scalars appear anywhere), asserting exact round-trip strings, paragraph count, and no-trailing-newline chomping normalization. Keep a separate `liveConfigSmokeParses` test against the real files that checks only parse-success and structural invariants, never prose. Verified the new test still catches a real decoder regression: with `str()` in MetadataConfig.swift temporarily sabotaged to collapse embedded blank lines, both the fixture test and the live smoke test fail (4 issues); reverted, full suite is green again. closes #1004 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
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
MetadataConfigLoadTests.decodesBlockScalarhardcoded exact marketing prose ("Truly cross-platform", "iPhone and Mac"); feat(store): apply marketing copy overhaul (P1-P5) across 7 locales #986's copy overhaul made both go stale, leavingPackages/ASCRegisterKitred (3 issues) on a clean main even though the config and the decoder were both correct.decodesBlockScalarFixture, which asserts the actual decoder property (block-scalar chomping + embedded blank-line paragraph preservation) against a fixture the test owns (Tests/ASCRegisterTests/Fixtures/BlockScalarFixture/), fully decoupled from shipping copy.liveConfigSmokeParsestest against the realdocs/app-store/metadatafiles that only checks parse-success + structural invariants (non-empty, blank-line preserved, no trailing newline) — never specific prose.Block-scalar form inventory (production)
Inventoried every
app-meta.yaml/listing.yamlunderdocs/app-store/metadata:|-(literal, strip chomping) — every listing.yaml'sdescription/whats_new/promotional_text.|(literal, clip chomping) —app-meta.yamlreview_information.notes_summaryandiap/*.yamlreview_notes.>folded scalars and no explicit indentation indicators appear anywhere.The fixture exercises both forms actually in use; it does not invent coverage for forms production never uses.
Test plan
swift test --package-path Packages/ASCRegisterKit— 195 tests, 0 issues (was 194 tests, 3 issues on main).MetadataConfig.str()to collapse embedded blank lines, both the fixture test (3 issues) and the live smoke test (1 issue) failed; reverted, verifiedgit diffon the source file is empty, full suite green again.swiftlint lint --strictclean on the changed test file (0 violations).closes #1004
🤖 Generated with Claude Code