fix: handle array-ref defaults in ConfigSmoke prompt()#13
Draft
Koan-Bot wants to merge 1 commit intoPerl-Toolchain-Gang:mainfrom
Draft
fix: handle array-ref defaults in ConfigSmoke prompt()#13Koan-Bot wants to merge 1 commit intoPerl-Toolchain-Gang:mainfrom
Koan-Bot wants to merge 1 commit intoPerl-Toolchain-Gang:mainfrom
Conversation
Options with `=s@` (repeatable strings), such as curlargs, have an array-ref as their default value. When prompt() used that ref in a string context it stringified to "ARRAY(0x...)" instead of showing the actual values. The fix converts any array-ref default to a space-joined string before display and input handling, then splits the result back into an array ref on return so callers receive the expected type. Also adds a configtext and configord to curlargs so the interactive prompt shows a descriptive question and appears after curlbin in the configuration flow. Fixes Perl-Toolchain-Gang#9 Co-Authored-By: Claude Sonnet 4.6 <[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
Options typed as
=s@(repeatable strings), such ascurlargs, store theirdefault as an array reference
[]. WhenConfigSmoke::prompt()placed thatref in string context for display it stringified to
ARRAY(0x...)instead ofshowing the actual values — producing the confusing output reported in the issue.
Fixes #9
Changes
lib/Test/Smoke/App/ConfigSmoke.pm— detect array-ref defaults inprompt(),convert to a space-joined string for display/input, and split back to an
array ref on return so callers receive the expected type.
lib/Test/Smoke/App/Options.pm— addconfigtextandconfigordtocurlargsso the interactive prompt shows a descriptive question and appears in a logical
order (after
curlbin).t/app/040-configsmoke-prompt.t— new test file covering empty-array default,non-empty array default, user-supplied input, and scalar-option regression.
Test plan
t/app/040-configsmoke-prompt.t(11 tests) covers the exactfailure scenario: before the fix, tests 1/4/5/8/9 failed with
ARRAY(0x...).perl -Ilib t/app/040-configsmoke-prompt.t— all 11 tests pass.t/app/suite shows no new failures (pre-existing macOS system_profilerwarning in 120/130/150 is unrelated to this change).
Generated by Kōan /fix
Quality Report
Changes: 3 files changed, 163 insertions(+), 5 deletions(-)
Code scan: clean
Tests: skipped
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline