Skip to content

Comments

fix(bash): glob pattern matching in [[ == ]] and [[ != ]]#244

Merged
chaliy merged 1 commit intomainfrom
claude/bashkit-bash-compatibility-BsDKD
Feb 24, 2026
Merged

fix(bash): glob pattern matching in [[ == ]] and [[ != ]]#244
chaliy merged 1 commit intomainfrom
claude/bashkit-bash-compatibility-BsDKD

Conversation

@chaliy
Copy link
Contributor

@chaliy chaliy commented Feb 24, 2026

Summary

  • [[ ]] conditional now uses glob matching (*, ?, [...]) for == and != operators
  • Previously did exact string comparison, causing [[ "hello.txt" == *.txt ]] to fail
  • Leverages existing pattern_matches() method

Test plan

  • 7 new tests: star, question, prefix, suffix, negation, no-match, exact
  • cargo test --all-features passes
  • cargo clippy and cargo fmt clean

[[ ]] conditional now uses glob matching (*, ?, [...]) for == and !=
operators instead of exact string comparison, matching bash behavior.
Uses existing pattern_matches() method.

Adds 7 test cases: star, question mark, prefix, suffix, negation,
no-match, exact.

https://claude.ai/code/session_012rzB3FRw7yoQWCG1mxyW7J
@chaliy chaliy merged commit e926822 into main Feb 24, 2026
16 checks passed
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.

2 participants