Skip to content

Commit 678ad32

Browse files
introduce infinite loop test for group
1 parent d1e5d70 commit 678ad32

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

test/src/map/group.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import test from 'ava' ;
22

3-
import { list , map , group } from '../../..' ;
3+
import { list , map , group , repeat , next , range } from '../../..' ;
44
import { identity } from 'aureooms-js-operator' ;
55

66
test( "group", t => {
@@ -56,6 +56,14 @@ test( "group", t => {
5656

5757
});
5858

59-
//test( 'group for infinite sequence of 0' , t => {
59+
test( 'group for infinite sequence of something' , t => {
6060

61-
//} );
61+
const v = Math.random( ) ;
62+
63+
[ k , g ] = next( group( identity , repeat( v ) ) ) ;
64+
65+
t.deepEqual( k , v ) ;
66+
67+
for ( let i of range( 1000 ) ) t.deepEqual( next( g ) , v ) ;
68+
69+
} );

0 commit comments

Comments
 (0)