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

inOrder error message not helpful for long lists #599

Closed
larsrc-google opened this issue Jul 3, 2019 · 1 comment · Fixed by #982
Closed

inOrder error message not helpful for long lists #599

larsrc-google opened this issue Jul 3, 2019 · 1 comment · Fixed by #982
Labels
P3 not scheduled type=addition A new feature

Comments

@larsrc-google
Copy link

While debugging a complex UI test, I got this failure message from a containsAtLeast(...).inOrder() check:

required elements were all found, but order was wrong
expected order for required elements: [7151434523449877363, 4252408486811896875, 4114668664172147474, 8110367050267853536, 4677975529779956966, 2765856572256769684, 1267967133679326155, 1188719784202927178, 6473040876350306456, 819996403327805209, 8994059835338470387]
but was                             : [7151434523449877363, 4252408486811896875, 8287628757811231685, 4114668664172147474, 1181298795318229905, 2876651819746693293, 4037740207275905307, 7533248967801703154, 5165279195580829813, 6024871345302940926, 6781408425477366010, 6779508724196595608, 705693376899489709, 5898841422154877596, 1258973575957529753, 8110367050267853536, 4677975529779956966, 2765856572256769684, 1267967133679326155, 2963862061825190586, 160847652129149574, 1188719784202927178, 8220312429118302792, 3395811380603979334, 7940388264055036139, 819996403327805209, 604818730662989506, 8994059835338470387, 7131862302014144278, 7763163560276301405, 8634857304955172842, 1022339347893700082, 8936610766401390744, 4983360437884526420, 2406627151731574013, 5178718059015209668, 1633226504530788427, 7367769801396399704, 6473040876350306456, 3644693952682290215, 2789968389188995389, 4156620871154003469, 2747331138783775177, 8047644822544636556, 4504839678137027357, 2583572736784365940, 58745421201523361, 91008229685601749]

Figuring out exactly which element is out of order took some eye-bleeding correlation. It would be nice if it output at least the first out-of-order element, possibly also the elements that were skipped leading up to it. Should be reasonably easy to have containsAtLeastElementsIn() remember the offending element rather than just the fact that it was not in order.

@cpovirk cpovirk added P3 not scheduled S1 - Important type=addition A new feature labels Jul 9, 2019
@cpovirk cpovirk added this to the First post-1.0 feature push milestone Jul 9, 2019
@cpovirk
Copy link
Member

cpovirk commented Jul 9, 2019

Agreed, thanks.

copybara-service bot pushed a commit that referenced this issue May 6, 2022
…int an extra line that shows only the expected elements in their actual order.

But only if the full contents contains elements that are not required.

Fixes #599, #974.

RELNOTES=Enhanced `IterableSubject.containsAtLeastElementsIn().inOrder()` to print an extra line that shows only the expected elements in their actual order.
PiperOrigin-RevId: 446727693
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 not scheduled type=addition A new feature
Projects
None yet
3 participants