test: add ReadConfigFile unit tests#71
Draft
toddr-bot wants to merge 3 commits into
Draft
Conversation
ReadConfigFile was only tested via slow integration tests that spawn real servers. Add 32 focused unit tests covering error paths (missing file, syntax errors, invalid return types) and the constructor's config-file integration (precedence: CLI > config > constructor attrs). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
cpm now requires Perl 5.24+, breaking CI on Perl 5.8-5.22. cpanm supports all Perl versions in the test matrix.
The defined-or operator (//) was introduced in Perl 5.10. Replace with (defined $x ? $x : '') to support Perl 5.8+.
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.
What
Add 32 unit tests for
ReadConfigFileand its integration with the constructor.Why
Config file loading was only exercised through slow integration tests (
config.t) that spawn real server processes. TheReadConfigFilemethod has six distinct error paths (missing file, syntax errors, invalid return types) plus complex precedence logic (CLI > config > constructor attrs) — none of which had direct unit coverage.How
New
t/readconfig.twith isolated tests usingFile::Tempconfig files and an overriddenFatal(same pattern asprivdrop.t). Tests cover:--configfileCLI flag,configfileconstructor attr, precedence orderingTesting
All 32 new tests pass. Full suite passes (108 tests, 19 files).
🤖 Generated with Claude Code
Quality Report
Changes: 2 files changed, 209 insertions(+)
Code scan: clean
Tests: passed (OK)
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline