var mkdirp=require("../").mkdirp,path=require("path"),fs=require("fs"),exists=fs.exists||path.exists,test=require("tap").test,_0777=parseInt("0777",8),_0755=parseInt("0755",8);test("race",function(t){t.plan(10);for(var r=["","tmp"],e=0;e<25;e++){var i=Math.floor(Math.random()*Math.pow(16,4)).toString(16);r.push(i)}var a=r.join("/");function o(r,e){mkdirp(r,_0755,function(e){t.ifError(e),exists(r,function(e){t.ok(e,"file created"),fs.stat(r,function(r,e){t.ifError(r),t.equal(e.mode&_0777,_0755),t.ok(e.isDirectory(),"target not a directory")})})})}o(a),o(a)});