test(cli): align unit test permissions with runtime test permissions (#12189)

This commit is contained in:
Casper Beyer 2021-09-23 07:50:50 +08:00 committed by GitHub
parent 87e78802b0
commit 830586d242
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 664 additions and 574 deletions

View file

@ -34,7 +34,7 @@ function assertDirectory(path: string, mode?: number) {
}
unitTest(
{ perms: { read: true, write: true } },
{ permissions: { read: true, write: true } },
function renameSyncSuccess() {
const testDir = Deno.makeTempDirSync();
const oldpath = testDir + "/oldpath";
@ -47,7 +47,7 @@ unitTest(
);
unitTest(
{ perms: { read: true, write: true } },
{ permissions: { read: true, write: true } },
function renameSyncWithURL() {
const testDir = Deno.makeTempDirSync();
const oldpath = testDir + "/oldpath";
@ -63,7 +63,7 @@ unitTest(
);
unitTest(
{ perms: { read: false, write: true } },
{ permissions: { read: false, write: true } },
function renameSyncReadPerm() {
assertThrows(() => {
const oldpath = "/oldbaddir";
@ -74,7 +74,7 @@ unitTest(
);
unitTest(
{ perms: { read: true, write: false } },
{ permissions: { read: true, write: false } },
function renameSyncWritePerm() {
assertThrows(() => {
const oldpath = "/oldbaddir";
@ -85,7 +85,7 @@ unitTest(
);
unitTest(
{ perms: { read: true, write: true } },
{ permissions: { read: true, write: true } },
async function renameSuccess() {
const testDir = Deno.makeTempDirSync();
const oldpath = testDir + "/oldpath";
@ -98,7 +98,7 @@ unitTest(
);
unitTest(
{ perms: { read: true, write: true } },
{ permissions: { read: true, write: true } },
async function renameWithURL() {
const testDir = Deno.makeTempDirSync();
const oldpath = testDir + "/oldpath";
@ -126,7 +126,10 @@ function writeFileString(filename: string, s: string) {
}
unitTest(
{ ignore: Deno.build.os === "windows", perms: { read: true, write: true } },
{
ignore: Deno.build.os === "windows",
permissions: { read: true, write: true },
},
function renameSyncErrorsUnix() {
const testDir = Deno.makeTempDirSync();
const oldfile = testDir + "/oldfile";
@ -201,7 +204,10 @@ unitTest(
);
unitTest(
{ ignore: Deno.build.os !== "windows", perms: { read: true, write: true } },
{
ignore: Deno.build.os !== "windows",
permissions: { read: true, write: true },
},
function renameSyncErrorsWin() {
const testDir = Deno.makeTempDirSync();
const oldfile = testDir + "/oldfile";