summaryrefslogtreecommitdiff
path: root/js/symlink_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'js/symlink_test.ts')
-rw-r--r--js/symlink_test.ts31
1 files changed, 15 insertions, 16 deletions
diff --git a/js/symlink_test.ts b/js/symlink_test.ts
index ab8463878..6fa78ac3f 100644
--- a/js/symlink_test.ts
+++ b/js/symlink_test.ts
@@ -1,25 +1,24 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { test, testPerm, assert, assertEqual } from "./test_util.ts";
-import * as deno from "deno";
testPerm({ read: true, write: true }, function symlinkSyncSuccess() {
- const testDir = deno.makeTempDirSync();
+ const testDir = Deno.makeTempDirSync();
const oldname = testDir + "/oldname";
const newname = testDir + "/newname";
- deno.mkdirSync(oldname);
+ Deno.mkdirSync(oldname);
let errOnWindows;
// Just for now, until we implement symlink for Windows.
try {
- deno.symlinkSync(oldname, newname);
+ Deno.symlinkSync(oldname, newname);
} catch (e) {
errOnWindows = e;
}
if (errOnWindows) {
- assertEqual(errOnWindows.kind, deno.ErrorKind.Other);
+ assertEqual(errOnWindows.kind, Deno.ErrorKind.Other);
assertEqual(errOnWindows.message, "Not implemented");
} else {
- const newNameInfoLStat = deno.lstatSync(newname);
- const newNameInfoStat = deno.statSync(newname);
+ const newNameInfoLStat = Deno.lstatSync(newname);
+ const newNameInfoStat = Deno.statSync(newname);
assert(newNameInfoLStat.isSymlink());
assert(newNameInfoStat.isDirectory());
}
@@ -28,11 +27,11 @@ testPerm({ read: true, write: true }, function symlinkSyncSuccess() {
test(function symlinkSyncPerm() {
let err;
try {
- deno.symlinkSync("oldbaddir", "newbaddir");
+ Deno.symlinkSync("oldbaddir", "newbaddir");
} catch (e) {
err = e;
}
- assertEqual(err.kind, deno.ErrorKind.PermissionDenied);
+ assertEqual(err.kind, Deno.ErrorKind.PermissionDenied);
assertEqual(err.name, "PermissionDenied");
});
@@ -40,7 +39,7 @@ test(function symlinkSyncPerm() {
testPerm({ write: true }, function symlinkSyncNotImplemented() {
let err;
try {
- deno.symlinkSync("oldname", "newname", "dir");
+ Deno.symlinkSync("oldname", "newname", "dir");
} catch (e) {
err = e;
}
@@ -48,23 +47,23 @@ testPerm({ write: true }, function symlinkSyncNotImplemented() {
});
testPerm({ read: true, write: true }, async function symlinkSuccess() {
- const testDir = deno.makeTempDirSync();
+ const testDir = Deno.makeTempDirSync();
const oldname = testDir + "/oldname";
const newname = testDir + "/newname";
- deno.mkdirSync(oldname);
+ Deno.mkdirSync(oldname);
let errOnWindows;
// Just for now, until we implement symlink for Windows.
try {
- await deno.symlink(oldname, newname);
+ await Deno.symlink(oldname, newname);
} catch (e) {
errOnWindows = e;
}
if (errOnWindows) {
- assertEqual(errOnWindows.kind, deno.ErrorKind.Other);
+ assertEqual(errOnWindows.kind, Deno.ErrorKind.Other);
assertEqual(errOnWindows.message, "Not implemented");
} else {
- const newNameInfoLStat = deno.lstatSync(newname);
- const newNameInfoStat = deno.statSync(newname);
+ const newNameInfoLStat = Deno.lstatSync(newname);
+ const newNameInfoStat = Deno.statSync(newname);
assert(newNameInfoLStat.isSymlink());
assert(newNameInfoStat.isDirectory());
}