• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

moonbitlang / core / 1288

22 Sep 2025 03:48PM UTC coverage: 89.433% (-0.2%) from 89.604%
1288

Pull #2755

github

bobzhang
Fix partition functions returning absolute position for empty ranges

The partition and partition_by functions were inconsistently returning
absolute positions (actual_start) for empty/invalid ranges while returning
relative positions (i - actual_start) in normal cases. This caused incorrect
pivot position calculations in quick_sort functions.

Changes:
- Fixed partition() to return (0, true) instead of (actual_start, true) for empty ranges
- Fixed partition_by() to return (0, true) instead of (actual_start, true) for empty ranges
- Added comprehensive test cases to verify the fix handles edge cases correctly
- Tests specifically cover non-zero starting positions which would fail with the old bug
Pull Request #2755: hongbo/factor out slice

69 of 91 new or added lines in 2 files covered. (75.82%)

1 existing line in 1 file now uncovered.

9293 of 10391 relevant lines covered (89.43%)

198519.89 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

81.94
/array/sort_by.mbt


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc