Skip to content

fix(completion): correct behavior of slice past end of array#237

Merged
reubeno merged 1 commit into
mainfrom
slice-past-end-of-array
Oct 25, 2024
Merged

fix(completion): correct behavior of slice past end of array#237
reubeno merged 1 commit into
mainfrom
slice-past-end-of-array

Conversation

@reubeno
Copy link
Copy Markdown
Owner

@reubeno reubeno commented Oct 25, 2024

When using the substring/slice operator past the end of an array, make sure not to yield an empty string.

@github-actions
Copy link
Copy Markdown

Test Results

  2 files    9 suites   1m 5s ⏱️
498 tests 498 ✅ 0 💤 0 ❌
985 runs  985 ✅ 0 💤 0 ❌

Results for commit 6c17c42.

@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 60.71 μs 60.08 μs -0.63 μs ⚪ Unchanged
instantiate_shell_with_init_scripts 31094.64 μs 31875.78 μs 781.14 μs ⚪ Unchanged
parse_bash_completion 2783.53 μs 2733.24 μs -50.29 μs 🟢 -1.81%
parse_sample_script 4.17 μs 4.17 μs 0.00 μs ⚪ Unchanged
run_echo_builtin_command 89.89 μs 89.98 μs 0.10 μs ⚪ Unchanged
run_one_builtin_command 107.47 μs 108.80 μs 1.33 μs ⚪ Unchanged
run_one_external_command 1955.11 μs 1985.91 μs 30.80 μs ⚪ Unchanged
run_one_external_command_directly 1018.09 μs 1014.64 μs -3.45 μs ⚪ Unchanged

Code Coverage Report: Only Changed Files listed

Package Base Coverage New Coverage Difference
brush-core/src/expansion.rs 🟢 95.92% 🟢 95.91% 🔴 -0.01%
brush-core/src/shell.rs 🟢 78.66% 🟢 78.52% 🔴 -0.14%
Overall Coverage 🟢 73.56% 🟢 73.55% 🔴 -0.01%

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

@reubeno reubeno merged commit 252e794 into main Oct 25, 2024
@reubeno reubeno deleted the slice-past-end-of-array branch October 25, 2024 05:07
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