Skip to content

Assert unreachable paths instead of returning errors - #324

Merged
jquast merged 4 commits into
masterfrom
jq/assertions
Nov 13, 2026
Merged

jquast merged 4 commits into
masterfrom
jq/assertions

Conversation

@jquast

@jquast jquast commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Fuzzing and AI static analysis found these wholly unreachable, so they
are converted to asserts. 32-bit builds keep explicit overflow checks.

Fuzzing and AI static analysis found these wholly unreachable, so they
are converted to asserts. 32-bit builds keep explicit overflow checks.
@codspeed

codspeed Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

1 warning

⚠️ Upgrade your CodSpeed plugin for Python 3.15

pytest-codspeed 5.0.3 is only tested on Python 3.9, 3.10, 3.11, 3.12, 3.13, and 3.14, so your Python 3.15 measurements may be inaccurate. Upgrade pytest-codspeed to 5.0.4 or later.

See affected benchmarks

✅ 146 untouched benchmarks


Comparing jq/assertions (f43da25) with master (37deca7)

Open in CodSpeed

@codecov

codecov Bot commented Nov 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 39.28571% with 34 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.28%. Comparing base (bff731c) to head (b69dbce).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
libwcwidth/src/width.c 45.00% 0 Missing and 11 partials ⚠️
libwcwidth/src/textwrap.c 40.00% 0 Missing and 9 partials ⚠️
libwcwidth/src/grapheme.c 0.00% 0 Missing and 5 partials ⚠️
libwcwidth/src/clip.c 50.00% 0 Missing and 3 partials ⚠️
libwcwidth/src/sgr.c 0.00% 0 Missing and 3 partials ⚠️
libwcwidth/src/utf8.c 0.00% 0 Missing and 2 partials ⚠️
libwcwidth/src/escape.c 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #324      +/-   ##
==========================================
+ Coverage   88.74%   90.28%   +1.53%     
==========================================
  Files          41       41              
  Lines        5677     5597      -80     
  Branches     1526     1513      -13     
==========================================
+ Hits         5038     5053      +15     
+ Misses        254      165      -89     
+ Partials      385      379       -6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jquast

jquast commented Nov 13, 2026

Copy link
Copy Markdown
Owner Author

coverage will be provided in a dedicated PR, branch test/c-coverage-100 soon

@jquast
jquast merged commit 7eceab9 into master Nov 13, 2026
31 of 33 checks passed
@jquast
jquast deleted the jq/assertions branch November 13, 2026 14:34
jquast added a commit that referenced this pull request Nov 13, 2026
Raise libwcwidth line coverage to 100%, branch coverage varies by compiler, CI reports almost 96, but the limit is set to 89.

By testing reachable paths, enabling assertions with #324, Careful fuzzing, tests, and consideration is given to try to discover wither code is truly unreachable, and input-size-dependent overflow checks are given for 32-bit builds.
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