var mkdirp=require("../"),path=require("path"),fs=require("fs"),exists=fs.exists||path.exists,test=require("tap").test,_0777=parseInt("0777",8),_0755=parseInt("0755",8);test("sync",function(t){t.plan(4);var r="/tmp/"+[Math.floor(Math.random()*Math.pow(16,4)).toString(16),Math.floor(Math.random()*Math.pow(16,4)).toString(16),Math.floor(Math.random()*Math.pow(16,4)).toString(16)].join("/");try{mkdirp.sync(r,_0755)}catch(r){return t.fail(r),t.end()}exists(r,function(a){t.ok(a,"file created"),fs.stat(r,function(r,a){t.ifError(r),t.equal(a.mode&_0777,_0755),t.ok(a.isDirectory(),"target not a directory")})})});