Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(arithmetic): support explicit base#literal in arithmetic #388

Merged
merged 1 commit into from
Feb 20, 2025

Conversation

reubeno
Copy link
Owner

@reubeno reubeno commented Feb 20, 2025

Implements support for arithmetic literals like 2#1010 and 16#32f.

The native Rust facility to parsing integers with an explicit radix only supports base 2-36. That's pretty reasonable, but bash technically supports up through base 64. For now, we do our best with the native facilities.

Copy link

Test Results

    2 files      9 suites   1m 38s ⏱️
  689 tests   689 ✅ 0 💤 0 ❌
1 364 runs  1 364 ✅ 0 💤 0 ❌

Results for commit 8b4f552.

Copy link

Performance Benchmark Report

Benchmark name Baseline (μs) Test/PR (μs) Delta (μs) Delta %
clone_shell_object 18.21 μs 18.03 μs -0.18 μs ⚪ Unchanged
eval_arithmetic 0.17 μs 0.17 μs 0.00 μs ⚪ Unchanged
expand_one_string 1.84 μs 1.79 μs -0.04 μs ⚪ Unchanged
for_loop 22.10 μs 22.02 μs -0.09 μs ⚪ Unchanged
function_call 2.29 μs 2.30 μs 0.00 μs ⚪ Unchanged
instantiate_shell 57.21 μs 56.42 μs -0.79 μs 🟢 -1.38%
instantiate_shell_with_init_scripts 21162.00 μs 21230.09 μs 68.09 μs ⚪ Unchanged
parse_bash_completion 1682.13 μs 1692.29 μs 10.16 μs ⚪ Unchanged
parse_sample_script 1.76 μs 1.79 μs 0.03 μs 🟠 +1.70%
run_echo_builtin_command 15.09 μs 15.36 μs 0.27 μs ⚪ Unchanged
run_one_external_command 2371.51 μs 2192.19 μs -179.32 μs 🟢 -7.56%
tokenize_sample_script 2.93 μs 2.91 μs -0.02 μs ⚪ Unchanged

Code Coverage Report: Only Changed Files listed

Package Base Coverage New Coverage Difference
brush-core/src/options.rs 🟢 92.39% 🟢 93.48% 🟢 1.09%
Overall Coverage 🟢 78.24% 🟢 78.27% 🟢 0.03%

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

Test Summary: bash-completion test suite

Outcome Count Percentage
✅ Pass 1331 63.38
❗️ Error 227 10.81
❌ Fail 157 7.48
⏩ Skip 370 17.62
❎ Expected Fail 14 0.67
✔️ Unexpected Pass 1 0.05
📊 Total 2100 100.00

@reubeno reubeno merged commit 6ffa47b into main Feb 20, 2025
18 checks passed
@reubeno reubeno deleted the explicit-radix-literal branch February 20, 2025 07:15
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