var recurse = require('../');
var test = require('tap').test;
var fs = require('fs');
var mkdirp = require('mkdirp');
var rimraf = require('rimraf');
var concat = require('concat-stream');

test('recursive dirs', function (t) {
  var files = [
    'recursive/1.txt',
    'recursive/2.txt',
    'recursive/sub/3.txt',
    'recursive/sub/subsub/4.txt',
    'recursive/sub/subsub/subsubsub/5.txt',
    'recursive/sub/subsub/subsubsub/6.txt'
  ];

  mkdirp.sync('recursive/sub/subsub/subsubsub');
  mkdirp.sync('recursive/sub/subsub/empty');

  files.forEach(function(f) {
    fs.openSync(f, 'w');
  });

  t.plan(1);

  var recursive = recurse('recursive');

  var all = concat(function(data) {
    t.equal(data, files.join(''));
    rimraf.sync('recursive');
  });

  recursive.pipe(all);
});

@@ -75,24 +75,56 @@
 uire('fs');%0A
+var Stream = require('stream');%0A
 var mkdirp =
@@ -178,47 +178,8 @@
 f');
-%0Avar concat = require('concat-stream');
 %0A%0Ate
@@ -658,56 +658,181 @@
 l = 
-concat(function(data) %7B%0A    t.equal(data
+%5B%5D;%0A  var concat = new Stream;%0A  concat.writable = true;%0A  concat.write = function(data) %7B%0A    all.push(data);%0A  %7D%0A  concat.end = function() %7B%0A    t.equal(all.sort()
 , files.
 join
@@ -831,15 +831,13 @@
 les.
-join(''
+sort(
 ));%0A
@@ -865,26 +865,24 @@
 rsive');%0A  %7D
-);
 %0A%0A  recursiv
@@ -888,18 +888,21 @@
 ve.pipe(
-all
+concat
 );%0A%7D);%0A

Make recursive test independent of ordering.