提交 3c24b9f7 编写于 作者: J J2P 提交者: Ryan Dahl

Fix trace test code

上级 f156a860
......@@ -8,7 +8,7 @@ testPerm({ write: true }, async function traceFunctionSuccess() {
// Mixing sync and async calls
const filename = deno.makeTempDirSync() + "/test.txt";
await deno.writeFile(filename, data, 0o666);
await deno.removeSync(filename);
deno.removeSync(filename);
});
assertEqual(op.length, 3);
assertEqual(op[0], { sync: true, name: "MakeTempDir" });
......@@ -25,7 +25,7 @@ testPerm({ write: true }, async function tracePromiseSuccess() {
// Mixing sync and async calls
const filename = deno.makeTempDirSync() + "/test.txt";
await deno.writeFile(filename, data, 0o666);
await deno.removeSync(filename);
deno.removeSync(filename);
};
const promise = Promise.resolve().then(asyncFunction);
const op = await deno.trace(promise);
......@@ -39,7 +39,7 @@ testPerm({ write: true }, async function traceRepeatSuccess() {
const op1 = await deno.trace(async () => await deno.makeTempDir());
assertEqual(op1.length, 1);
assertEqual(op1[0], { sync: false, name: "MakeTempDir" });
const op2 = await deno.trace(async () => await deno.statSync("."));
const op2 = await deno.trace(() => deno.statSync("."));
assertEqual(op2.length, 1);
assertEqual(op2[0], { sync: true, name: "Stat" });
});
......@@ -75,7 +75,7 @@ testPerm({ write: true }, async function traceIdempotence() {
assertEqual(op3[0], { sync: false, name: "Remove" });
// Expect top-level repeat still works after all the nestings
const op4 = await deno.trace(async () => await deno.statSync("."));
const op4 = await deno.trace(() => deno.statSync("."));
assertEqual(op4.length, 1);
assertEqual(op4[0], { sync: true, name: "Stat" });
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册