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

Update IteratorTester example with a greater "steps" value #5281

Closed
wants to merge 1 commit into from

Conversation

jbduncan
Copy link
Contributor

@jbduncan jbduncan commented Oct 15, 2020

Builds upon my earlier work in #5272 and #5276, whilst also addressing #5254 a bit.

This allows IteratorTester to check the edge case that when an iterator has been exhausted (that is, "next" has been called repeatedly until "hasNext" returns false) then calling "next" on the iterator again exhibits the same behavior as the user's chosen "known good" reference implementation.
@@ -50,6 +50,10 @@
* verify() method, which is called <em>after</em> each sequence and is guaranteed to be called
* using the latest values obtained from {@link IteratorTester#newTargetIterator()}.
*
* <p>The value you pass to the parameter {@code steps} should be greater than the length of your
* iterator, so that this class can check that your iterator exhibits the same edge-case behavior as
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think of just saying "...that your iterator exhibits the correct behavior when it is exhaused?"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that sounds good to me. 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if you were expecting me to update the docs or if you were happy to do it yourself?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I'm taking care of it. The PR is out for internal review.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cheers @cpovirk! 👍

@cpovirk cpovirk added P2 package=testing type=api-docs Change/add API documentation labels Oct 15, 2020
@cpovirk cpovirk self-assigned this Oct 15, 2020
@cpovirk cpovirk mentioned this pull request Oct 16, 2020
cpovirk pushed a commit that referenced this pull request Oct 16, 2020
This allows IteratorTester to check the edge case that when an iterator has been exhausted (that is, "next" has been called repeatedly until "hasNext" returns false) then calling "next" on the iterator again exhibits the same behavior as the user's chosen "known good" reference implementation.

Fixes #5281

RELNOTES=n/a

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=337541752
cpovirk pushed a commit that referenced this pull request Oct 16, 2020
This allows IteratorTester to check the edge case that when an iterator has been exhausted (that is, "next" has been called repeatedly until "hasNext" returns false) then calling "next" on the iterator again exhibits the same behavior as the user's chosen "known good" reference implementation.

Fixes #5281

RELNOTES=n/a

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=337541752
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants