2020-02-25 15:36:35 -05:00
|
|
|
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
|
2020-06-12 15:23:38 -04:00
|
|
|
const name = Deno.args[0];
|
2020-11-03 10:19:29 -05:00
|
|
|
// deno-lint-ignore no-explicit-any
|
2020-08-24 19:43:54 -04:00
|
|
|
const test: { [key: string]: (...args: any[]) => void | Promise<void> } = {
|
2020-03-20 09:38:34 -04:00
|
|
|
readRequired(): Promise<void> {
|
2020-06-12 15:23:38 -04:00
|
|
|
Deno.readFileSync("README.md");
|
2020-03-20 09:38:34 -04:00
|
|
|
return Promise.resolve();
|
2020-02-25 15:36:35 -05:00
|
|
|
},
|
|
|
|
writeRequired(): void {
|
2020-06-12 15:23:38 -04:00
|
|
|
Deno.makeTempDirSync();
|
2020-02-25 15:36:35 -05:00
|
|
|
},
|
|
|
|
envRequired(): void {
|
2020-06-12 15:23:38 -04:00
|
|
|
Deno.env.get("home");
|
2020-02-25 15:36:35 -05:00
|
|
|
},
|
|
|
|
netRequired(): void {
|
2020-06-12 15:23:38 -04:00
|
|
|
Deno.listen({ transport: "tcp", port: 4541 });
|
2020-02-25 15:36:35 -05:00
|
|
|
},
|
|
|
|
runRequired(): void {
|
2020-11-08 05:50:27 -05:00
|
|
|
const p = Deno.run({
|
|
|
|
cmd: ["printf", "hello"],
|
2020-02-25 15:36:35 -05:00
|
|
|
});
|
2020-11-08 05:50:27 -05:00
|
|
|
p.close();
|
2020-03-28 13:03:49 -04:00
|
|
|
},
|
2020-02-25 15:36:35 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
if (!test[name]) {
|
|
|
|
console.log("Unknown test:", name);
|
2020-06-12 15:23:38 -04:00
|
|
|
Deno.exit(1);
|
2020-02-25 15:36:35 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
test[name]();
|