Skip to content

fix: allow usually-operator chars in regex parens#224

Merged
reubeno merged 1 commit into
mainfrom
special-chars-in-regex-parens
Oct 24, 2024
Merged

fix: allow usually-operator chars in regex parens#224
reubeno merged 1 commit into
mainfrom
special-chars-in-regex-parens

Conversation

@reubeno
Copy link
Copy Markdown
Owner

@reubeno reubeno commented Oct 24, 2024

In an extended test command, the following example regex is not allowed:

[[ str =~ < ]]

But if it's placed in parentheses, it is allowed:

[[ str =~ (<) ]]

These changes relax our parser's restrictions on which tokens typically parsed as operators may be allowed in that context. We add a compat test case to confirm.

Addresses one of the issues identified by #222.

@github-actions
Copy link
Copy Markdown

Test Results

  2 files    9 suites   1m 15s ⏱️
482 tests 482 ✅ 0 💤 0 ❌
955 runs  955 ✅ 0 💤 0 ❌

Results for commit 718403b.

@github-actions
Copy link
Copy Markdown

Performance Benchmark Report

Benchmark name Baseline (μs) Test/PR (μs) Delta (μs) Delta %
expand_one_string 3.42 μs 3.42 μs 0.00 μs ⚪ Unchanged
instantiate_shell 59.81 μs 59.79 μs -0.02 μs ⚪ Unchanged
instantiate_shell_with_init_scripts 30321.58 μs 30446.13 μs 124.55 μs ⚪ Unchanged
parse_bash_completion 2782.41 μs 2764.22 μs -18.20 μs ⚪ Unchanged
parse_sample_script 4.16 μs 4.18 μs 0.02 μs ⚪ Unchanged
run_echo_builtin_command 89.84 μs 89.22 μs -0.62 μs ⚪ Unchanged
run_one_builtin_command 108.61 μs 109.06 μs 0.45 μs ⚪ Unchanged
run_one_external_command 1921.22 μs 1918.21 μs -3.01 μs ⚪ Unchanged
run_one_external_command_directly 1013.11 μs 1006.29 μs -6.82 μs ⚪ Unchanged

Code Coverage Report: Only Changed Files listed

Package Base Coverage New Coverage Difference
brush-core/src/jobs.rs 🔴 42.42% 🔴 37.23% 🔴 -5.19%
Overall Coverage 🟢 76.42% 🟢 76.34% 🔴 -0.08%

Minimum allowed coverage is 70%, this run produced 76.34%

@reubeno reubeno merged commit 02fb19e into main Oct 24, 2024
@reubeno reubeno deleted the special-chars-in-regex-parens branch October 24, 2024 04:51
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