Skip to content

test_detect_cycle_with_cycle test in src/data_structures/floyds_algor… - #1079

Open
t-0 wants to merge 1 commit into
TheAlgorithms:masterfrom
t-0:bugfix/floyds_algorithm_crash
Open

t-0 wants to merge 1 commit into
TheAlgorithms:masterfrom
t-0:bugfix/floyds_algorithm_crash

Conversation

@t-0

@t-0 t-0 commented Nov 30, 2026

Copy link
Copy Markdown

Description

cargo test crashing with memory corruption.

In test_detect_cycle_with_cycle test in src/data_structures/floyds_algorithm.rs, unsafe code points the list's last node back at the first. It then runs cleanup code which follows that cycle, corrupting the test process.

Type of change

  • [x ] Bug fix (non-breaking change which fixes an issue)

Checklist:

  • [x ] I ran bellow commands using the latest version of rust nightly.
  • I ran cargo clippy --all -- -D warnings just before my last commit and fixed any issue that was found.
  • I ran cargo fmt just before my last commit.
  • I ran cargo test just before my last commit and all tests passed.
  • I checked CONTRIBUTING.md and my code follows its guidelines.

…ithm.rs points the last node to start and follows the cycle when cleaning up
@t-0
t-0 requested a review from imp2002 as a code owner November 30, 2026 20:16
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 96.17%. Comparing base (976f1cd) to head (cb26a34).

Files with missing lines Patch % Lines
src/data_structures/floyds_algorithm.rs 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1079      +/-   ##
==========================================
- Coverage   96.17%   96.17%   -0.01%     
==========================================
  Files         396      396              
  Lines       30418    30421       +3     
==========================================
+ Hits        29254    29256       +2     
- Misses       1164     1165       +1     

☔ 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.

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