fix(std): make array-kind validation case-sensitive under nocasematch - #525
Conversation
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
shopt -s nocasematch.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.batsbats --filter 'array output contracts distinguish indexed from associative arrays with nocasematch' lib/bash/str/tests/lib_str.batsbats 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
nocasematchcase from #521 on both hosted runnerplatforms.
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.