Skip to content

fix(std): make array-kind validation case-sensitive under nocasematch - #525

Open
codeforester wants to merge 1 commit into
bug/509-20260917-bug-define-and-enforce-attributes-for-caller-owned-output-vafrom
bug/524-20260919-bug-make-array-kind-validation-case-sensitive-under-nocasema
Open

codeforester wants to merge 1 commit into
bug/509-20260917-bug-define-and-enforce-attributes-for-caller-owned-output-vafrom
bug/524-20260919-bug-make-array-kind-validation-case-sensitive-under-nocasema

Conversation

@codeforester

@codeforester codeforester commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Make array-kind diagnostics case-sensitive even when callers enable
    shopt -s nocasematch.
  • Add a focused stdlib regression test for the indexed/associative distinction.
  • Correct the string-split regression assertion so an associative output is
    expected to fail the array-kind contract before the later writability check.

Issue

Fixes #524

Related to #521: this is a dependent follow-up to the caller-owned output
contract change and is intentionally based on #521's branch.

Validation

  • bats --filter 'array-kind validation keeps indexed diagnostics case-sensitive with nocasematch' lib/bash/std/tests/lib_std.bats
  • bats --filter 'array output contracts distinguish indexed from associative arrays with nocasematch' lib/bash/str/tests/lib_str.bats
  • bats lib/bash/std/tests/lib_std.bats lib/bash/str/tests/lib_str.bats lib/bash/list/tests/lib_list.bats lib/bash/arg/tests/lib_arg.bats (309 tests passed)
  • ./tests/validate.sh (680 BATS tests and all repository contracts passed)

Docs Impact

None. The existing API contract already requires the documented array kind.

API Impact

None. This preserves the existing return status and contract; it only makes
the diagnostic deterministic under caller shell options.

CI Impact

This restores the failing nocasematch case from #521 on both hosted runner
platforms.

Security Notes

None.

Notes

The source change uses the same numeric marker-byte comparison already used by
the surrounding array declaration validator, avoiding Bash pattern matching
under nocasematch. Merge #521 before or together with this dependent PR.

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.

1 participant