varmkdirp=require('../').mkdirp;varpath=require('path');varfs=require('fs');varexists=fs.exists||path.exists;vartest=require('tap').test;var_0777=parseInt('0777',8);var_0755=parseInt('0755',8);test('race',function(t){t.plan(10);varps=['','tmp'];for(vari=0;i<25;i++){vardir=Math.floor(Math.random()*Math.pow(16,4)).toString(16);ps.push(dir);}varfile=ps.join('/');varres=2;mk(file);mk(file);functionmk(file,cb){mkdirp(file,_0755,function(err){t.ifError(err);exists(file,function(ex){t.ok(ex,'file created');fs.stat(file,function(err,stat){t.ifError(err);t.equal(stat.mode&_0777,_0755);t.ok(stat.isDirectory(),'target not a directory');});})});}});