diff options
author | Mani Maghsoudlou <manidlou@gmail.com> | 2018-09-12 08:44:58 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-09-12 11:44:58 -0400 |
commit | 88d42f0b189a1daa3fb44eb24ecad77823557d9f (patch) | |
tree | ac4d166271d9708472b16150f5f6dcc712095fcb /js/os_test.ts | |
parent | 26081a32dfaf34fdc8b6cf53222c15f3d4e4f30d (diff) |
Implement deno.rename() (#731)
Diffstat (limited to 'js/os_test.ts')
-rw-r--r-- | js/os_test.ts | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/js/os_test.ts b/js/os_test.ts index c0198095c..61227a3b1 100644 --- a/js/os_test.ts +++ b/js/os_test.ts @@ -60,40 +60,3 @@ test(function makeTempDirSyncPerm() { assertEqual(err.kind, deno.ErrorKind.PermissionDenied); assertEqual(err.name, "PermissionDenied"); }); - -testPerm({ write: true }, function renameSync() { - const testDir = deno.makeTempDirSync() + "/test-rename"; - const oldpath = testDir + "/oldpath"; - const newpath = testDir + "/newpath"; - deno.mkdirSync(oldpath); - deno.renameSync(oldpath, newpath); - const newPathInfo = deno.statSync(newpath); - assert(newPathInfo.isDirectory()); - - let caughtErr = false; - let oldPathInfo; - - try { - oldPathInfo = deno.statSync(oldpath); - } catch (err) { - caughtErr = true; - assertEqual(err.kind, deno.ErrorKind.NotFound); - assertEqual(err.name, "NotFound"); - } - - assert(caughtErr); - assertEqual(oldPathInfo, undefined); -}); - -test(function renameSyncPerm() { - let err; - try { - const oldpath = "/oldbaddir"; - const newpath = "/newbaddir"; - deno.renameSync(oldpath, newpath); - } catch (err_) { - err = err_; - } - assertEqual(err.kind, deno.ErrorKind.PermissionDenied); - assertEqual(err.name, "PermissionDenied"); -}); |