mirror of
https://github.com/bvanroll/rpiRadio.git
synced 2025-08-31 13:02:44 +00:00
Initial Commit
This commit is contained in:
29
ProjectNow/NodeServer/node_modules/event-stream/test/merge.asynct.js
generated
vendored
Normal file
29
ProjectNow/NodeServer/node_modules/event-stream/test/merge.asynct.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
var es = require('../')
|
||||
, it = require('it-is').style('colour')
|
||||
, d = require('ubelt')
|
||||
|
||||
exports.merge = function (t) {
|
||||
var odd = d.map(1, 3, 100, d.id) //array of multiples of 3 < 100
|
||||
var even = d.map(2, 4, 100, d.id) //array of multiples of 3 < 100
|
||||
|
||||
var r1 = es.readArray(even)
|
||||
var r2 = es.readArray(odd)
|
||||
var endCount = 0
|
||||
|
||||
var writer = es.writeArray(function (err, array){
|
||||
if(err) throw err //unpossible
|
||||
it(array.sort()).deepEqual(even.concat(odd).sort())
|
||||
if (++endCount === 2) t.done()
|
||||
})
|
||||
|
||||
var writer2 = es.writeArray(function (err, array){
|
||||
if(err) throw err //unpossible
|
||||
it(array.sort()).deepEqual(even.concat(odd).sort())
|
||||
if (++endCount === 2) t.done()
|
||||
})
|
||||
|
||||
es.merge(r1, r2).pipe(writer)
|
||||
es.merge([r1, r2]).pipe(writer2)
|
||||
|
||||
}
|
||||
require('./helper')(module)
|
Reference in New Issue
Block a user