Skip to content

verify_in_list and verify_same_elements should handle lists of size 0, and None #19

@alex-l-kong

Description

@alex-l-kong

Describe the bug

If a list of size 0 is passed to either of these validation functions, a ValueError is thrown because the comparison doesn't know how to handle empty list arguments.

Expected behavior

verify_in_list

If the LHL (left-hand list) passed is empty, then it will always be contained in the RHL (right-hand list).

If the RHL is empty, then the LHL will never be contained in it.

The one edge case that needs to be handled is if both lists are empty. In this specific instance, the empty list is always contained in the empty list and should return True.

verify_same_elements

If one list is empty, then the return value should be False unless the other list is also empty, in which case True should be returned.

To Reproduce

Pass one or two empty lists to either of these functions.

Screenshot 2023-01-31 at 11 29 41 PM

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions