-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Lists Should Be Equal
keyword in Collections should have an option to ignore order
#2703
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
Comments
Sounds reasonable. What about duplicates? |
I haven't given some thoughts about duplicates, but I guess we can have an "ignore_duplicates" argument as well. |
This Pseudo code
As length of both lists are, same we need to check first list's element in 2nd list in case of ignore_order. |
Hi @pekkaklarck,
If we add these two lines before for loop in the existing given function will compare two UN-ordered lists. Case 1: Case 2: Case 3: PASS Adding more tests and verifying it
|
Lists Should Be Equal With Different Values Ignore_order :: FAIL L... | PASS |Lists Should Be Equal With Different Values And Own Error Message ... | PASS |Lists Should Be Equal With Different Values And Own And Default Er... | PASS |Lists Should Be Equal With Named Indices As List Ignore_order :: F... | FAIL |
|
@bbpatel2001, I don't understand the usage of |
As Pekka notes, sorting the list contents and comparing those sorted lists is the easiest way to do this, and the way that I've handled this situation in other projects when I only care about list contents rather than order. |
why not to use the "should be equal" keyword in buildin? |
What about introducing Set concept into framework itself and into Collections with related For now we have |
I don't think sets are needed so often that they'd require a separate variable type. |
May this one help? |
Hi @pekkaklarck could you please review PR #3469 |
is this PR #3469 RF 3.2 candidate? |
Lists Should Be Equal
keywords in Collections should have the option to ignore order
Lists Should Be Equal
keywords in Collections should have the option to ignore orderLists Should Be Equal
keywords in Collections should have an option to ignore order
This was implemented by PR #3469. Thanks a lot @bbpatel2001! |
Lists Should Be Equal
keywords in Collections should have an option to ignore orderLists Should Be Equal
keyword in Collections should have an option to ignore order
…#2703. Also tab to spaces in a test.
when comparing lists, we sometimes want to compare only the content irregardless of the order.
Currently, the
Lists should be equal
ensures each index in the list is the same.So the following test case fails
If I wanted to get this test to pass, I would need to use a combination of keywords found in
Collections
andBuiltIn
.I would be nice to be able to do something as follows:
This ticket has been opened to improve the
Lists should be equal
keywords to include a way to ignore the orders of the list.The text was updated successfully, but these errors were encountered: