Skip to content

Test for merge_sort_in_place is not verifying in-place sorting #287

Description

@WarVDine

Code reference

https://github.com/LambdaSchool/Sorting/blob/c273860239b5147fb1a65d8f27ccc31eb032723d/src/recursive_sorting/test_recursive.py#L21-L31

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 #288 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions