/** * Test the things() iterator generating utility function. */ public void testThings() { ExtendedIterator<String> it1 = things( "now is the time" ); ExtendedIterator<String> it2 = things( "now is the time" ); ExtendedIterator<String> mt1 = things( "" ); ExtendedIterator<String> mt2 = things( "" ); assertEquals( "mt1.hasNext()", false, mt1.hasNext() ); assertEquals( "mt2.hasNext()", false, mt2.hasNext() ); assertEquals( "andThen(mt1,mt2).hasNext()", false, mt1.andThen( mt2 ).hasNext() ); assertEquals( "butNot(it1,it2).hasNext()", false, CompositionBase.butNot( it1, it2 ).hasNext() ); assertEquals( "x y z @butNot z", true, CompositionBase.butNot( things( "x y z" ), things( "z" ) ).hasNext() ); assertEquals( "x y z @butNot a", true, CompositionBase.butNot( things( "x y z" ), things( "z" ) ).hasNext() ); }
/** * Test the things() iterator generating utility function. */ public void testThings() { ExtendedIterator<String> it1 = things( "now is the time" ); ExtendedIterator<String> it2 = things( "now is the time" ); ExtendedIterator<String> mt1 = things( "" ); ExtendedIterator<String> mt2 = things( "" ); assertEquals( "mt1.hasNext()", false, mt1.hasNext() ); assertEquals( "mt2.hasNext()", false, mt2.hasNext() ); assertEquals( "andThen(mt1,mt2).hasNext()", false, mt1.andThen( mt2 ).hasNext() ); assertEquals( "butNot(it1,it2).hasNext()", false, CompositionBase.butNot( it1, it2 ).hasNext() ); assertEquals( "x y z @butNot z", true, CompositionBase.butNot( things( "x y z" ), things( "z" ) ).hasNext() ); assertEquals( "x y z @butNot a", true, CompositionBase.butNot( things( "x y z" ), things( "z" ) ).hasNext() ); }