Skip to content

fix: handle array-ref defaults in ConfigSmoke prompt()#13

Draft
Koan-Bot wants to merge 1 commit intoPerl-Toolchain-Gang:mainfrom
Koan-Bot:koan.atoomic/fix-issue-9
Draft

fix: handle array-ref defaults in ConfigSmoke prompt()#13
Koan-Bot wants to merge 1 commit intoPerl-Toolchain-Gang:mainfrom
Koan-Bot:koan.atoomic/fix-issue-9

Conversation

@Koan-Bot
Copy link

@Koan-Bot Koan-Bot commented Mar 19, 2026

Summary

Options typed as =s@ (repeatable strings), such as curlargs, store their
default as an array reference []. When ConfigSmoke::prompt() placed that
ref in string context for display it stringified to ARRAY(0x...) instead of
showing the actual values — producing the confusing output reported in the issue.

Fixes #9

Changes

  • lib/Test/Smoke/App/ConfigSmoke.pm — detect array-ref defaults in prompt(),
    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 — add configtext and configord to curlargs
    so 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

  • New test file t/app/040-configsmoke-prompt.t (11 tests) covers the exact
    failure 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.
  • Full t/app/ suite shows no new failures (pre-existing macOS system_profiler
    warning 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

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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug in next question when choosing curl in tsconfigsmoke.pl

1 participant