import test from 'ava' ;

	 import {
		 range ,
		 by ,
		 zip ,
		 list } from '../../..' ;
test( 'by' , t => {


	const A = by( range( 100 ) , 2 ) ;
	const B = zip( range( 0 , 100 , 2 ) , range( 1 , 100 , 2 ) ) ;

	t.deepEqual( list( A ) , list( B ) , 'compare to zip output' ) ;

	const C = by( range( 4 ) , 3 ) ;

	t.deepEqual( list( C ) , [ [ 0 , 1 , 2 ] , [ 3 , undefined , undefined ] ] , 'n !| N' ) ;

	const D = by( '' , 3 ) ;

	t.deepEqual( list( D ) , [ ] , 'empty' ) ;

} ) ;


@@ -23,18 +23,16 @@
  ;%0A%0A
-%09 
 import %7B
 %0A%09%09 
@@ -31,19 +31,16 @@
 rt %7B
-%0A%09%09
  range ,
 %0A%09%09 
@@ -39,34 +39,40 @@
 ge ,
-%0A%09%09
  by ,
-%0A%09%09
  zip ,
-%0A%09%09
  list 
+, count , head 
 %7D fr
@@ -87,16 +87,17 @@
 ./..' ;%0A
+%0A
 test( 'b
@@ -109,17 +109,16 @@
 t =%3E %7B%0A%0A
-%0A
 %09const A
@@ -479,12 +479,243 @@
 ) ;%0A%0A%7D ) ;%0A%0A
+test( 'by (infinite sequences)' , t =%3E %7B%0A%0A%09const A = by( count( ) , 2 ) ;%0A%09const B = zip( count( 0 , 2 ) , count( 1 , 2 ) ) ;%0A%0A%09t.deepEqual( list( head( A , 1000 ) ) , list( head( B , 1000 ) ) , 'compare to zip output' ) ;%0A%0A%7D ) ;%0A%0A

test by with infinite generators