Improve test coverage and clean up dead code (#43)#46
Draft
Improve test coverage and clean up dead code (#43)#46
Conversation
- Add 5 tests: Codable round-trip, Settings.bundle coding keys, empty acknowledgements, sorting behavior, and sorting consistency between lowercased() and localizedStandardCompare - Remove EnvironmentKey.swift — unused since initial commit (2021), only SRCROOT and PROJECT_TEMP_DIR are needed and used as literals Closes #43 Phase 1
- Extract path-parsing logic into testable deriveCheckoutsPath() function - Add 6 DeriveCheckoutsPathTests: standard path, archive builds (#6), "Build" in username (#40), multiple Build segments, fallback - Add 5 PlistEncodingTests: both output formats, multiline license preservation, file write round-trip - Fix ackgen.sh: missing $ in SDKROOT command substitution Closes #43 Phase 2
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
Addresses #43 (Improve unit and integration test coverage) — Phases 1 and 2.
Phase 1: Unit tests + dead code removal
AcknowledgementsStringsTableTests.swift(5 tests): Codable round-trip, Settings.bundle coding keys, empty acknowledgements, sorting behavior, sorting consistencyEnvironmentKey.swift— dead code since 2021, never referencedPhase 2: Extract testable functions + integration tests
deriveCheckoutsPath(from:)from inline logic inrun()DeriveCheckoutsPathTests.swift(6 tests): standard paths, archive builds (AckGen not found... #6), "Build" in username (Fix path detection when Build appears in directory names #40), multiple Build segments, fallbackPlistEncodingTests.swift(5 tests): both output formats, multiline license preservation, file write round-tripBug fix
Example/ackgen.sh: missing$inSDKROOTcommand substitutionTest count: 31 → 42 (+11 new tests, 0 failures)
Closes #43 (Phases 1 & 2; Phase 3 UI tests remain low priority)
Test plan
swift buildsucceeds afterEnvironmentKeyremoval