reubeno / brush

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

fix: assorted correctness issues in getopts builtin #225

Closed reubeno closed 1 month ago

reubeno commented 1 month ago

The getopts builtin wasn't handling a handful of cases correctly.

Addresses one of the issues encountered while debugging #222.

github-actions[bot] commented 1 month ago

Test Results

  2 files    9 suites   1m 13s ⏱️ 488 tests 488 ✅ 0 💤 0 ❌ 967 runs  967 ✅ 0 💤 0 ❌

Results for commit 574a7f03.

github-actions[bot] commented 1 month 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 60.78 μs 60.60 μs -0.19 μs ⚪ Unchanged
instantiate_shell_with_init_scripts 30473.03 μs 30414.60 μs -58.43 μs ⚪ Unchanged
parse_bash_completion 2775.40 μs 2754.15 μs -21.25 μs 🟢 -0.77%
parse_sample_script 4.22 μs 4.27 μs 0.04 μs 🟠 +0.97%
run_echo_builtin_command 89.59 μs 89.38 μs -0.21 μs ⚪ Unchanged
run_one_builtin_command 108.90 μs 108.82 μs -0.08 μs ⚪ Unchanged
run_one_external_command 1954.42 μs 1951.37 μs -3.05 μs ⚪ Unchanged
run_one_external_command_directly 1006.49 μs 1007.23 μs 0.73 μs ⚪ Unchanged

Code Coverage Report: Only Changed Files listed

Package Base Coverage New Coverage Difference
brush-core/src/builtins/getopts.rs 🟢 91.14% 🟢 95.9% 🟢 4.76%
brush-core/src/shell.rs 🟢 78.4% 🟢 78.68% 🟢 0.28%
Overall Coverage 🟢 73.45% 🟢 73.56% 🟢 0.11%

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