Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fs read permission (don't squash) #1689

Merged
merged 6 commits into from
Feb 8, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix
  • Loading branch information
dsseng committed Feb 8, 2019
commit 9b72a7190d2e49aef0a2e8acad01251a48d210f0
4 changes: 2 additions & 2 deletions js/truncate_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async function readData(name: string): Promise<string> {
return text;
}

testPerm({ write: true }, function truncateSyncSuccess() {
testPerm({ read: true, write: true }, function truncateSyncSuccess() {
const enc = new TextEncoder();
const d = enc.encode("Hello");
const filename = deno.makeTempDirSync() + "/test_truncateSync.txt";
Expand All @@ -33,7 +33,7 @@ testPerm({ write: true }, function truncateSyncSuccess() {
deno.removeSync(filename);
});

testPerm({ write: true }, async function truncateSuccess() {
testPerm({ read: true, write: true }, async function truncateSuccess() {
const enc = new TextEncoder();
const d = enc.encode("Hello");
const filename = deno.makeTempDirSync() + "/test_truncate.txt";
Expand Down
20 changes: 10 additions & 10 deletions js/write_file_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { testPerm, assert, assertEqual } from "./test_util.ts";
import * as deno from "deno";

testPerm({ write: true }, function writeFileSyncSuccess() {
testPerm({ read: true, write: true }, function writeFileSyncSuccess() {
const enc = new TextEncoder();
const data = enc.encode("Hello");
const filename = deno.makeTempDirSync() + "/test.txt";
Expand Down Expand Up @@ -45,7 +45,7 @@ testPerm({ write: false }, function writeFileSyncPerm() {
assert(caughtError);
});

testPerm({ write: true }, function writeFileSyncUpdatePerm() {
testPerm({ read: true, write: true }, function writeFileSyncUpdatePerm() {
if (deno.platform.os !== "win") {
const enc = new TextEncoder();
const data = enc.encode("Hello");
Expand All @@ -57,7 +57,7 @@ testPerm({ write: true }, function writeFileSyncUpdatePerm() {
}
});

testPerm({ write: true }, function writeFileSyncCreate() {
testPerm({ read: true, write: true }, function writeFileSyncCreate() {
const enc = new TextEncoder();
const data = enc.encode("Hello");
const filename = deno.makeTempDirSync() + "/test.txt";
Expand All @@ -81,7 +81,7 @@ testPerm({ write: true }, function writeFileSyncCreate() {
assertEqual("Hello", actual);
});

testPerm({ write: true }, function writeFileSyncAppend() {
testPerm({ read: true, write: true }, function writeFileSyncAppend() {
const enc = new TextEncoder();
const data = enc.encode("Hello");
const filename = deno.makeTempDirSync() + "/test.txt";
Expand All @@ -103,7 +103,7 @@ testPerm({ write: true }, function writeFileSyncAppend() {
assertEqual("Hello", actual);
});

testPerm({ write: true }, async function writeFileSuccess() {
testPerm({ read: true, write: true }, async function writeFileSuccess() {
const enc = new TextEncoder();
const data = enc.encode("Hello");
const filename = deno.makeTempDirSync() + "/test.txt";
Expand All @@ -114,7 +114,7 @@ testPerm({ write: true }, async function writeFileSuccess() {
assertEqual("Hello", actual);
});

testPerm({ write: true }, async function writeFileNotFound() {
testPerm({ read: true, write: true }, async function writeFileNotFound() {
const enc = new TextEncoder();
const data = enc.encode("Hello");
const filename = "/baddir/test.txt";
Expand All @@ -130,7 +130,7 @@ testPerm({ write: true }, async function writeFileNotFound() {
assert(caughtError);
});

testPerm({ write: false }, async function writeFilePerm() {
testPerm({ read: true, write: false }, async function writeFilePerm() {
const enc = new TextEncoder();
const data = enc.encode("Hello");
const filename = "/baddir/test.txt";
Expand All @@ -146,7 +146,7 @@ testPerm({ write: false }, async function writeFilePerm() {
assert(caughtError);
});

testPerm({ write: true }, async function writeFileUpdatePerm() {
testPerm({ read: true, write: true }, async function writeFileUpdatePerm() {
if (deno.platform.os !== "win") {
const enc = new TextEncoder();
const data = enc.encode("Hello");
Expand All @@ -158,7 +158,7 @@ testPerm({ write: true }, async function writeFileUpdatePerm() {
}
});

testPerm({ write: true }, async function writeFileCreate() {
testPerm({ read: true, write: true }, async function writeFileCreate() {
const enc = new TextEncoder();
const data = enc.encode("Hello");
const filename = deno.makeTempDirSync() + "/test.txt";
Expand All @@ -182,7 +182,7 @@ testPerm({ write: true }, async function writeFileCreate() {
assertEqual("Hello", actual);
});

testPerm({ write: true }, async function writeFileAppend() {
testPerm({ read: true, write: true }, async function writeFileAppend() {
const enc = new TextEncoder();
const data = enc.encode("Hello");
const filename = deno.makeTempDirSync() + "/test.txt";
Expand Down