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 perm",function(t){t.plan(4);var r="/tmp/"+(Math.random()*(1<<30)).toString(16)+".json";mkdirp.sync(r,_0755),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")})})}),test("sync root perm",function(t){t.plan(3);mkdirp.sync("/tmp",_0755),exists("/tmp",function(r){t.ok(r,"file created"),fs.stat("/tmp",function(r,e){t.ifError(r),t.ok(e.isDirectory(),"target not a directory")})})});