mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 17:59:55 +02:00
17 lines
342 B
JavaScript
17 lines
342 B
JavaScript
var tape = require('tape')
|
|
var iterate = require('./')
|
|
|
|
tape('iterates all', function (t) {
|
|
var ite = iterate([1, 2, 3, 4, 5, 6, 7, 8, 9])
|
|
var found = {}
|
|
|
|
for (var i = 0; i < 9; i++) {
|
|
var j = ite()
|
|
t.ok(!!j, 'not null')
|
|
if (found[j]) t.ok(false, 'duplicate')
|
|
found[j] = true
|
|
}
|
|
|
|
t.ok(!ite(), 'no more')
|
|
t.end()
|
|
})
|