2020-02-25 20:36:35 +00:00
|
|
|
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
|
2020-06-12 20:23:38 +01:00
|
|
|
const name = Deno.args[0];
|
2020-11-03 16:19:29 +01:00
|
|
|
// deno-lint-ignore no-explicit-any
|
2020-08-25 09:43:54 +10:00
|
|
|
const test: { [key: string]: (...args: any[]) => void | Promise<void> } = {
|
2021-08-05 13:08:58 +02:00
|
|
|
readRequired() {
|
2022-09-19 09:32:21 -05:00
|
|
|
Deno.readFileSync("assets/hello.txt");
|
2020-03-20 14:38:34 +01:00
|
|
|
return Promise.resolve();
|
2020-02-25 20:36:35 +00:00
|
|
|
},
|
2021-08-05 13:08:58 +02:00
|
|
|
writeRequired() {
|
2020-06-12 20:23:38 +01:00
|
|
|
Deno.makeTempDirSync();
|
2020-02-25 20:36:35 +00:00
|
|
|
},
|
2021-08-05 13:08:58 +02:00
|
|
|
envRequired() {
|
2020-06-12 20:23:38 +01:00
|
|
|
Deno.env.get("home");
|
2020-02-25 20:36:35 +00:00
|
|
|
},
|
2021-08-05 13:08:58 +02:00
|
|
|
netRequired() {
|
2020-06-12 20:23:38 +01:00
|
|
|
Deno.listen({ transport: "tcp", port: 4541 });
|
2020-02-25 20:36:35 +00:00
|
|
|
},
|
2022-05-18 22:00:11 +02:00
|
|
|
async runRequired() {
|
2022-12-02 14:43:17 +01:00
|
|
|
await new Deno.Command(Deno.build.os === "windows" ? "cmd.exe" : "printf", {
|
2022-05-18 22:00:11 +02:00
|
|
|
args: Deno.build.os === "windows" ? ["/c", "echo hello"] : ["hello"],
|
2022-12-02 14:43:17 +01:00
|
|
|
}).output();
|
2020-03-29 04:03:49 +11:00
|
|
|
},
|
2020-02-25 20:36:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
if (!test[name]) {
|
|
|
|
console.log("Unknown test:", name);
|
2020-06-12 20:23:38 +01:00
|
|
|
Deno.exit(1);
|
2020-02-25 20:36:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
test[name]();
|