var falafel=require("falafel"),tape=require("../"),tap=require("tap");tap.test("array test",function(e){e.plan(1);var n=tape.createHarness(),t=tap.createConsumer(),r=[];t.on("data",function(e){r.push(e)}),t.on("end",function(){var n=r.map(function(e){return e&&"object"==typeof e?{id:e.id,ok:e.ok,name:e.name.trim()}:e});e.same(n,["TAP version 13","nested array test",{id:1,ok:!0,name:"should be equivalent"},{id:2,ok:!0,name:"should be equivalent"},{id:3,ok:!0,name:"should be equivalent"},{id:4,ok:!0,name:"should be equivalent"},{id:5,ok:!0,name:"should be equivalent"},"inside test",{id:6,ok:!0,name:"(unnamed assert)"},{id:7,ok:!0,name:"(unnamed assert)"},"another",{id:8,ok:!0,name:"(unnamed assert)"},"tests 8","pass  8","ok"])}),n.stream.pipe(t),n("nested array test",function(e){e.plan(5);var n="("+function(){var e=[1,2,[3,4]],n=[5,6];g([e,n])}+")()",t=falafel(n,function(e){"ArrayExpression"===e.type&&e.update("fn("+e.source()+")")});e.test("inside test",function(e){e.plan(2),e.ok(!0),setTimeout(function(){e.ok(!0)},100)});var r=[[3,4],[1,2,[3,4]],[5,6],[[1,2,[3,4]],[5,6]]];Function(["fn","g"],t)(function(n){return e.same(r.shift(),n),n},function(n){e.same(n,[[1,2,[3,4]],[5,6]])})}),n("another",function(e){e.plan(1),setTimeout(function(){e.ok(!0)},50)})});