MCPcopy Index your code
hub / github.com/apache/groovy / testIterator

Method testIterator

src/test/groovy/groovy/lang/EmptyRangeTest.java:279–289  ·  view source on GitHub ↗

Test method for groovy.lang.EmptyRange#iterator().

()

Source from the content-addressed store, hash-verified

277 * Test method for {@link groovy.lang.EmptyRange#iterator()}.
278 */
279 public void testIterator() {
280 final Iterator iterator = range.iterator();
281 assertFalse("iterator has next value", iterator.hasNext());
282
283 try {
284 iterator.next();
285 fail("got next value in an empty range");
286 } catch (NoSuchElementException e) {
287 assertTrue("expected exception thrown", true);
288 }
289 }
290
291 /**
292 * Tests removing via an iterator.

Callers

nothing calls this directly

Calls 4

iteratorMethod · 0.65
hasNextMethod · 0.45
nextMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected