Skip to content

Fix sort failure in badge creation when only one MATLAB version is tested#48

Merged
ehennestad merged 4 commits intomainfrom
copilot/investigate-issue-46
Mar 20, 2026
Merged

Fix sort failure in badge creation when only one MATLAB version is tested#48
ehennestad merged 4 commits intomainfrom
copilot/investigate-issue-46

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 18, 2026

When only one MATLAB release is present, regexp on a scalar string returns the match directly (not in a cell), causing {:} indexing to extract individual characters. sort then operates on a 6-element char array instead of a 1-element string, producing out-of-bounds indices for a 1-element testResultsListing.

Changes

  • getReleaseNamesFromFolderPaths: Pass folderPaths through cellstr() before regexp to force cell array output regardless of input size; wrap result with string() for consistent type:

    % Before
    releaseNames = regexp(folderPaths, 'R\d{4}[ab]', 'match');
    result = [releaseNames{:}];
    
    % After
    releaseNames = regexp(cellstr(folderPaths), 'R\d{4}[ab]', 'match');
    result = string([releaseNames{:}]);
  • Sort alignment: releaseNames was not reordered alongside testResultsListing, causing mismatched release name/file pairs in the loop for multi-version runs. Added releaseNames = releaseNames(sortedIndices).

  • Cleanup: Removed unused folderNames variable and stray disp call.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: ehennestad <17237719+ehennestad@users.noreply.github.com>
Copilot AI changed the title [WIP] Investigate issue #46 Fix sort failure in badge creation when only one MATLAB version is tested Mar 18, 2026
Copilot AI requested a review from ehennestad March 18, 2026 11:58
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 18, 2026

Test Results

21 tests   21 ✅  24s ⏱️
 5 suites   0 💤
 1 files     0 ❌

Results for commit 3e7d4e0.

♻️ This comment has been updated with latest results.

@ehennestad ehennestad marked this pull request as ready for review March 18, 2026 15:23
@ehennestad ehennestad merged commit aa73295 into main Mar 20, 2026
4 checks passed
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 20, 2026

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 41.72%. Comparing base (2491817) to head (3e7d4e0).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
...e/+matbox/+tasks/createTestedWithBadgeforToolbox.m 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #48      +/-   ##
==========================================
- Coverage   42.26%   41.72%   -0.55%     
==========================================
  Files          59       59              
  Lines        1455     1462       +7     
==========================================
- Hits          615      610       -5     
- Misses        840      852      +12     

☔ View full report in Codecov by Sentry.
📢 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.

@ehennestad ehennestad deleted the copilot/investigate-issue-46 branch March 22, 2026 16:48
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.

2 participants