Skip to content

test: verify insertion sort modifies input collection - #15335

Open
SwetaKumari7 wants to merge 2 commits into
TheAlgorithms:masterfrom
SwetaKumari7:improve-insertion-sort
Open

SwetaKumari7 wants to merge 2 commits into
TheAlgorithms:masterfrom
SwetaKumari7:improve-insertion-sort

Conversation

@SwetaKumari7

Copy link
Copy Markdown

Description

Add a doctest to verify that insertion_sort modifies the input collection in place and returns the same collection.

Changes

  • Verify that the returned object is the original collection.
  • Verify that the original collection is sorted after the function call.

Testing

  • python -m doctest -v sorts/insertion_sort.py
  • python -m ruff check sorts/insertion_sort.py

Both checks pass.

@cclauss

cclauss commented Sep 15, 2026

Copy link
Copy Markdown
Member

ON HOLD: Our focus is on merging or closing old pull requests before October 1st.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants