Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_in_place_merge_sort does not tests for sorting in place #12

Open
DevWarr opened this issue Jun 12, 2020 · 0 comments
Open

test_in_place_merge_sort does not tests for sorting in place #12

DevWarr opened this issue Jun 12, 2020 · 0 comments

Comments

@DevWarr
Copy link

DevWarr commented Jun 12, 2020

Code Reference

https://github.com/LambdaSchool/cs-module-project-recursive-sorting/blob/0fd49e2dbd425875300446e6bc444d6350cf3ae9/src/recursive_sorting/test_recursive.py#L21-L34

Bug

In-place sorting means that the initially passed in array will be modified, and does not need to be re-assigned.

If the merge_sort_in_place() function creates a new array and returns it without modifying the original, this test should fail. Currently, it does not.

Fix

Call the merge_sort_in_place() function before testing, and then assertEqual() the array itself to the expected value. This should test whether the array was truly modified in place.

Fixed in PR #11.

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

No branches or pull requests

1 participant