reubeno / brush

bash/POSIX-compatible shell implemented in Rust
MIT License
20 stars 4 forks source link

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

Closed reubeno closed 5 days ago

reubeno commented 5 days ago

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[bot] commented 5 days ago

Test Results

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

Results for commit 718403b0.

github-actions[bot] commented 5 days ago

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%