mirror of
https://github.com/denoland/deno.git
synced 2025-10-03 07:34:36 +00:00
BREAKING: Use LLVM target triple for Deno.build (#4948)
Deno.build.os values have changed to correspond to standard LLVM target triples "win" -> "windows" "mac" -> "darwin"
This commit is contained in:
parent
f7ab19b1b7
commit
e0ca60e770
50 changed files with 165 additions and 188 deletions
|
@ -17,7 +17,7 @@ unitTest(function simpleTestFn(): void {
|
|||
});
|
||||
|
||||
unitTest({
|
||||
ignore: Deno.build.os === "win",
|
||||
ignore: Deno.build.os === "windows",
|
||||
perms: { read: true, write: true },
|
||||
},
|
||||
function complexTestFn(): void {
|
||||
|
|
|
@ -66,7 +66,7 @@ unitTest(function nativeEndLine(): void {
|
|||
};
|
||||
const blob = new Blob(["Hello\nWorld"], options);
|
||||
|
||||
assertEquals(blob.size, Deno.build.os === "win" ? 12 : 11);
|
||||
assertEquals(blob.size, Deno.build.os === "windows" ? 12 : 11);
|
||||
});
|
||||
|
||||
unitTest(async function blobText(): Promise<void> {
|
||||
|
|
|
@ -5,6 +5,6 @@ unitTest(function buildInfo(): void {
|
|||
// Deno.build is injected by rollup at compile time. Here
|
||||
// we check it has been properly transformed.
|
||||
const { arch, os } = Deno.build;
|
||||
assert(arch === "x64");
|
||||
assert(os === "mac" || os === "win" || os === "linux");
|
||||
assert(arch.length > 0);
|
||||
assert(os === "darwin" || os === "windows" || os === "linux");
|
||||
});
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
import { unitTest, assert, assertEquals } from "./test_util.ts";
|
||||
|
||||
unitTest(
|
||||
{ ignore: Deno.build.os === "win", perms: { read: true, write: true } },
|
||||
{ ignore: Deno.build.os === "windows", perms: { read: true, write: true } },
|
||||
function chmodSyncSuccess(): void {
|
||||
const enc = new TextEncoder();
|
||||
const data = enc.encode("Hello");
|
||||
|
@ -21,7 +21,7 @@ unitTest(
|
|||
// Check symlink when not on windows
|
||||
unitTest(
|
||||
{
|
||||
ignore: Deno.build.os === "win",
|
||||
ignore: Deno.build.os === "windows",
|
||||
perms: { read: true, write: true },
|
||||
},
|
||||
function chmodSyncSymlinkSuccess(): void {
|
||||
|
@ -73,7 +73,7 @@ unitTest({ perms: { write: false } }, function chmodSyncPerm(): void {
|
|||
});
|
||||
|
||||
unitTest(
|
||||
{ ignore: Deno.build.os === "win", perms: { read: true, write: true } },
|
||||
{ ignore: Deno.build.os === "windows", perms: { read: true, write: true } },
|
||||
async function chmodSuccess(): Promise<void> {
|
||||
const enc = new TextEncoder();
|
||||
const data = enc.encode("Hello");
|
||||
|
@ -93,7 +93,7 @@ unitTest(
|
|||
|
||||
unitTest(
|
||||
{
|
||||
ignore: Deno.build.os === "win",
|
||||
ignore: Deno.build.os === "windows",
|
||||
perms: { read: true, write: true },
|
||||
},
|
||||
async function chmodSymlinkSuccess(): Promise<void> {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
import { unitTest, assertEquals, assert } from "./test_util.ts";
|
||||
|
||||
// chown on Windows is noop for now, so ignore its testing on Windows
|
||||
if (Deno.build.os !== "win") {
|
||||
if (Deno.build.os !== "windows") {
|
||||
async function getUidAndGid(): Promise<{ uid: number; gid: number }> {
|
||||
// get the user ID and group ID of the current process
|
||||
const uidProc = Deno.run({
|
||||
|
|
|
@ -10,7 +10,7 @@ unitTest({ perms: { write: true } }, function dirCwdChdirSuccess(): void {
|
|||
const path = Deno.makeTempDirSync();
|
||||
Deno.chdir(path);
|
||||
const current = Deno.cwd();
|
||||
if (Deno.build.os === "mac") {
|
||||
if (Deno.build.os === "darwin") {
|
||||
assertEquals(current, "/private" + path);
|
||||
} else {
|
||||
assertEquals(current, path);
|
||||
|
@ -20,7 +20,7 @@ unitTest({ perms: { write: true } }, function dirCwdChdirSuccess(): void {
|
|||
|
||||
unitTest({ perms: { write: true } }, function dirCwdError(): void {
|
||||
// excluding windows since it throws resource busy, while removeSync
|
||||
if (["linux", "mac"].includes(Deno.build.os)) {
|
||||
if (["linux", "darwin"].includes(Deno.build.os)) {
|
||||
const initialdir = Deno.cwd();
|
||||
const path = Deno.makeTempDirSync();
|
||||
Deno.chdir(path);
|
||||
|
|
|
@ -172,7 +172,7 @@ unitTest(
|
|||
});
|
||||
file.close();
|
||||
const pathInfo = Deno.statSync(path);
|
||||
if (Deno.build.os !== "win") {
|
||||
if (Deno.build.os !== "windows") {
|
||||
assertEquals(pathInfo.mode! & 0o777, 0o626 & ~Deno.umask());
|
||||
}
|
||||
}
|
||||
|
@ -191,7 +191,7 @@ unitTest(
|
|||
});
|
||||
file.close();
|
||||
const pathInfo = Deno.statSync(path);
|
||||
if (Deno.build.os !== "win") {
|
||||
if (Deno.build.os !== "windows") {
|
||||
assertEquals(pathInfo.mode! & 0o777, 0o626 & ~Deno.umask());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ unitTest({ perms: { read: true } }, function watchFsInvalidPath() {
|
|||
Deno.watchFs("non-existant.file");
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
if (Deno.build.os === "win") {
|
||||
if (Deno.build.os === "windows") {
|
||||
assert(
|
||||
err.message.includes(
|
||||
"Input watch path is neither a file nor a directory"
|
||||
|
|
|
@ -31,7 +31,7 @@ unitTest(
|
|||
function makeTempDirSyncMode(): void {
|
||||
const path = Deno.makeTempDirSync();
|
||||
const pathInfo = Deno.statSync(path);
|
||||
if (Deno.build.os !== "win") {
|
||||
if (Deno.build.os !== "windows") {
|
||||
assertEquals(pathInfo.mode! & 0o777, 0o700 & ~Deno.umask());
|
||||
}
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ unitTest(
|
|||
async function makeTempDirMode(): Promise<void> {
|
||||
const path = await Deno.makeTempDir();
|
||||
const pathInfo = Deno.statSync(path);
|
||||
if (Deno.build.os !== "win") {
|
||||
if (Deno.build.os !== "windows") {
|
||||
assertEquals(pathInfo.mode! & 0o777, 0o700 & ~Deno.umask());
|
||||
}
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ unitTest(
|
|||
function makeTempFileSyncMode(): void {
|
||||
const path = Deno.makeTempFileSync();
|
||||
const pathInfo = Deno.statSync(path);
|
||||
if (Deno.build.os !== "win") {
|
||||
if (Deno.build.os !== "windows") {
|
||||
assertEquals(pathInfo.mode! & 0o777, 0o600 & ~Deno.umask());
|
||||
}
|
||||
}
|
||||
|
@ -171,7 +171,7 @@ unitTest(
|
|||
async function makeTempFileMode(): Promise<void> {
|
||||
const path = await Deno.makeTempFile();
|
||||
const pathInfo = Deno.statSync(path);
|
||||
if (Deno.build.os !== "win") {
|
||||
if (Deno.build.os !== "windows") {
|
||||
assertEquals(pathInfo.mode! & 0o777, 0o600 & ~Deno.umask());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import { unitTest, assert, assertEquals, assertThrows } from "./test_util.ts";
|
|||
function assertDirectory(path: string, mode?: number): void {
|
||||
const info = Deno.lstatSync(path);
|
||||
assert(info.isDirectory);
|
||||
if (Deno.build.os !== "win" && mode !== undefined) {
|
||||
if (Deno.build.os !== "windows" && mode !== undefined) {
|
||||
assertEquals(info.mode! & 0o777, mode & ~Deno.umask());
|
||||
}
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ unitTest(
|
|||
Deno.mkdirSync(path, { recursive: true });
|
||||
Deno.mkdirSync(path, { recursive: true, mode: 0o731 });
|
||||
assertDirectory(path, 0o737);
|
||||
if (Deno.build.os != "win") {
|
||||
if (Deno.build.os !== "windows") {
|
||||
const pathLink = path + "Link";
|
||||
Deno.symlinkSync(path, pathLink);
|
||||
Deno.mkdirSync(pathLink, { recursive: true });
|
||||
|
@ -144,7 +144,7 @@ unitTest(
|
|||
await Deno.mkdir(path, { recursive: true });
|
||||
await Deno.mkdir(path, { recursive: true, mode: 0o731 });
|
||||
assertDirectory(path, 0o737);
|
||||
if (Deno.build.os != "win") {
|
||||
if (Deno.build.os !== "windows") {
|
||||
const pathLink = path + "Link";
|
||||
Deno.symlinkSync(path, pathLink);
|
||||
await Deno.mkdir(pathLink, { recursive: true });
|
||||
|
@ -178,7 +178,7 @@ unitTest(
|
|||
Deno.mkdirSync(file, { recursive: true });
|
||||
}, Deno.errors.AlreadyExists);
|
||||
|
||||
if (Deno.build.os !== "win") {
|
||||
if (Deno.build.os !== "windows") {
|
||||
const fileLink = testDir + "/fileLink";
|
||||
const dirLink = testDir + "/dirLink";
|
||||
const danglingLink = testDir + "/danglingLink";
|
||||
|
|
|
@ -18,7 +18,7 @@ unitTest(
|
|||
{
|
||||
perms: { net: true },
|
||||
// TODO:
|
||||
ignore: Deno.build.os === "win",
|
||||
ignore: Deno.build.os === "windows",
|
||||
},
|
||||
function netUdpListenClose(): void {
|
||||
const socket = Deno.listen({
|
||||
|
@ -34,7 +34,7 @@ unitTest(
|
|||
);
|
||||
|
||||
unitTest(
|
||||
{ ignore: Deno.build.os === "win", perms: { read: true, write: true } },
|
||||
{ ignore: Deno.build.os === "windows", perms: { read: true, write: true } },
|
||||
function netUnixListenClose(): void {
|
||||
const filePath = Deno.makeTempFileSync();
|
||||
const socket = Deno.listen({
|
||||
|
@ -48,7 +48,7 @@ unitTest(
|
|||
);
|
||||
|
||||
unitTest(
|
||||
{ ignore: Deno.build.os === "win", perms: { read: true, write: true } },
|
||||
{ ignore: Deno.build.os === "windows", perms: { read: true, write: true } },
|
||||
function netUnixPacketListenClose(): void {
|
||||
const filePath = Deno.makeTempFileSync();
|
||||
const socket = Deno.listen({
|
||||
|
@ -82,7 +82,7 @@ unitTest(
|
|||
);
|
||||
|
||||
unitTest(
|
||||
{ ignore: Deno.build.os === "win", perms: { read: true, write: true } },
|
||||
{ ignore: Deno.build.os === "windows", perms: { read: true, write: true } },
|
||||
async function netUnixCloseWhileAccept(): Promise<void> {
|
||||
const filePath = await Deno.makeTempFile();
|
||||
const listener = Deno.listen({
|
||||
|
@ -189,7 +189,7 @@ unitTest({ perms: { net: true } }, async function netTcpDialListen(): Promise<
|
|||
});
|
||||
|
||||
unitTest(
|
||||
{ ignore: Deno.build.os === "win", perms: { read: true, write: true } },
|
||||
{ ignore: Deno.build.os === "windows", perms: { read: true, write: true } },
|
||||
async function netUnixDialListen(): Promise<void> {
|
||||
const filePath = await Deno.makeTempFile();
|
||||
const listener = Deno.listen({ address: filePath, transport: "unix" });
|
||||
|
@ -225,7 +225,7 @@ unitTest(
|
|||
);
|
||||
|
||||
unitTest(
|
||||
{ ignore: Deno.build.os === "win", perms: { net: true } },
|
||||
{ ignore: Deno.build.os === "windows", perms: { net: true } },
|
||||
async function netUdpSendReceive(): Promise<void> {
|
||||
const alice = Deno.listen({ port: 4500, transport: "udp" });
|
||||
assert(alice.addr.transport === "udp");
|
||||
|
@ -253,7 +253,7 @@ unitTest(
|
|||
);
|
||||
|
||||
unitTest(
|
||||
{ ignore: Deno.build.os === "win", perms: { read: true, write: true } },
|
||||
{ ignore: Deno.build.os === "windows", perms: { read: true, write: true } },
|
||||
async function netUnixPacketSendReceive(): Promise<void> {
|
||||
const filePath = await Deno.makeTempFile();
|
||||
const alice = Deno.listen({ address: filePath, transport: "unixpacket" });
|
||||
|
@ -293,7 +293,7 @@ unitTest(
|
|||
);
|
||||
|
||||
unitTest(
|
||||
{ ignore: Deno.build.os === "win", perms: { net: true } },
|
||||
{ ignore: Deno.build.os === "windows", perms: { net: true } },
|
||||
async function netUdpListenCloseWhileIterating(): Promise<void> {
|
||||
const socket = Deno.listen({ port: 8000, transport: "udp" });
|
||||
const nextWhileClosing = socket[Symbol.asyncIterator]().next();
|
||||
|
@ -306,7 +306,7 @@ unitTest(
|
|||
);
|
||||
|
||||
unitTest(
|
||||
{ ignore: Deno.build.os === "win", perms: { read: true, write: true } },
|
||||
{ ignore: Deno.build.os === "windows", perms: { read: true, write: true } },
|
||||
async function netUnixListenCloseWhileIterating(): Promise<void> {
|
||||
const filePath = Deno.makeTempFileSync();
|
||||
const socket = Deno.listen({ address: filePath, transport: "unix" });
|
||||
|
@ -320,7 +320,7 @@ unitTest(
|
|||
);
|
||||
|
||||
unitTest(
|
||||
{ ignore: Deno.build.os === "win", perms: { read: true, write: true } },
|
||||
{ ignore: Deno.build.os === "windows", perms: { read: true, write: true } },
|
||||
async function netUnixPacketListenCloseWhileIterating(): Promise<void> {
|
||||
const filePath = Deno.makeTempFileSync();
|
||||
const socket = Deno.listen({ address: filePath, transport: "unixpacket" });
|
||||
|
|
|
@ -50,7 +50,7 @@ unitTest(function envPermissionDenied2(): void {
|
|||
// case-insensitive. Case normalization needs be done using the collation
|
||||
// that Windows uses, rather than naively using String.toLowerCase().
|
||||
unitTest(
|
||||
{ ignore: Deno.build.os !== "win", perms: { env: true, run: true } },
|
||||
{ ignore: Deno.build.os !== "windows", perms: { env: true, run: true } },
|
||||
async function envCaseInsensitive() {
|
||||
// Utility function that runs a Deno subprocess with the environment
|
||||
// specified in `inputEnv`. The subprocess reads the environment variables
|
||||
|
@ -116,7 +116,7 @@ unitTest(function osPid(): void {
|
|||
});
|
||||
|
||||
unitTest({ perms: { env: true } }, function getDir(): void {
|
||||
type supportOS = "mac" | "win" | "linux";
|
||||
type supportOS = "darwin" | "windows" | "linux";
|
||||
|
||||
interface Runtime {
|
||||
os: supportOS;
|
||||
|
@ -132,120 +132,120 @@ unitTest({ perms: { env: true } }, function getDir(): void {
|
|||
{
|
||||
kind: "config",
|
||||
runtime: [
|
||||
{ os: "mac", shouldHaveValue: true },
|
||||
{ os: "win", shouldHaveValue: true },
|
||||
{ os: "darwin", shouldHaveValue: true },
|
||||
{ os: "windows", shouldHaveValue: true },
|
||||
{ os: "linux", shouldHaveValue: true },
|
||||
],
|
||||
},
|
||||
{
|
||||
kind: "cache",
|
||||
runtime: [
|
||||
{ os: "mac", shouldHaveValue: true },
|
||||
{ os: "win", shouldHaveValue: true },
|
||||
{ os: "darwin", shouldHaveValue: true },
|
||||
{ os: "windows", shouldHaveValue: true },
|
||||
{ os: "linux", shouldHaveValue: true },
|
||||
],
|
||||
},
|
||||
{
|
||||
kind: "executable",
|
||||
runtime: [
|
||||
{ os: "mac", shouldHaveValue: false },
|
||||
{ os: "win", shouldHaveValue: false },
|
||||
{ os: "darwin", shouldHaveValue: false },
|
||||
{ os: "windows", shouldHaveValue: false },
|
||||
{ os: "linux", shouldHaveValue: true },
|
||||
],
|
||||
},
|
||||
{
|
||||
kind: "data",
|
||||
runtime: [
|
||||
{ os: "mac", shouldHaveValue: true },
|
||||
{ os: "win", shouldHaveValue: true },
|
||||
{ os: "darwin", shouldHaveValue: true },
|
||||
{ os: "windows", shouldHaveValue: true },
|
||||
{ os: "linux", shouldHaveValue: true },
|
||||
],
|
||||
},
|
||||
{
|
||||
kind: "data_local",
|
||||
runtime: [
|
||||
{ os: "mac", shouldHaveValue: true },
|
||||
{ os: "win", shouldHaveValue: true },
|
||||
{ os: "darwin", shouldHaveValue: true },
|
||||
{ os: "windows", shouldHaveValue: true },
|
||||
{ os: "linux", shouldHaveValue: true },
|
||||
],
|
||||
},
|
||||
{
|
||||
kind: "audio",
|
||||
runtime: [
|
||||
{ os: "mac", shouldHaveValue: true },
|
||||
{ os: "win", shouldHaveValue: true },
|
||||
{ os: "darwin", shouldHaveValue: true },
|
||||
{ os: "windows", shouldHaveValue: true },
|
||||
{ os: "linux", shouldHaveValue: false },
|
||||
],
|
||||
},
|
||||
{
|
||||
kind: "desktop",
|
||||
runtime: [
|
||||
{ os: "mac", shouldHaveValue: true },
|
||||
{ os: "win", shouldHaveValue: true },
|
||||
{ os: "darwin", shouldHaveValue: true },
|
||||
{ os: "windows", shouldHaveValue: true },
|
||||
{ os: "linux", shouldHaveValue: false },
|
||||
],
|
||||
},
|
||||
{
|
||||
kind: "document",
|
||||
runtime: [
|
||||
{ os: "mac", shouldHaveValue: true },
|
||||
{ os: "win", shouldHaveValue: true },
|
||||
{ os: "darwin", shouldHaveValue: true },
|
||||
{ os: "windows", shouldHaveValue: true },
|
||||
{ os: "linux", shouldHaveValue: false },
|
||||
],
|
||||
},
|
||||
{
|
||||
kind: "download",
|
||||
runtime: [
|
||||
{ os: "mac", shouldHaveValue: true },
|
||||
{ os: "win", shouldHaveValue: true },
|
||||
{ os: "darwin", shouldHaveValue: true },
|
||||
{ os: "windows", shouldHaveValue: true },
|
||||
{ os: "linux", shouldHaveValue: false },
|
||||
],
|
||||
},
|
||||
{
|
||||
kind: "font",
|
||||
runtime: [
|
||||
{ os: "mac", shouldHaveValue: true },
|
||||
{ os: "win", shouldHaveValue: false },
|
||||
{ os: "darwin", shouldHaveValue: true },
|
||||
{ os: "windows", shouldHaveValue: false },
|
||||
{ os: "linux", shouldHaveValue: true },
|
||||
],
|
||||
},
|
||||
{
|
||||
kind: "picture",
|
||||
runtime: [
|
||||
{ os: "mac", shouldHaveValue: true },
|
||||
{ os: "win", shouldHaveValue: true },
|
||||
{ os: "darwin", shouldHaveValue: true },
|
||||
{ os: "windows", shouldHaveValue: true },
|
||||
{ os: "linux", shouldHaveValue: false },
|
||||
],
|
||||
},
|
||||
{
|
||||
kind: "public",
|
||||
runtime: [
|
||||
{ os: "mac", shouldHaveValue: true },
|
||||
{ os: "win", shouldHaveValue: true },
|
||||
{ os: "darwin", shouldHaveValue: true },
|
||||
{ os: "windows", shouldHaveValue: true },
|
||||
{ os: "linux", shouldHaveValue: false },
|
||||
],
|
||||
},
|
||||
{
|
||||
kind: "template",
|
||||
runtime: [
|
||||
{ os: "mac", shouldHaveValue: false },
|
||||
{ os: "win", shouldHaveValue: true },
|
||||
{ os: "darwin", shouldHaveValue: false },
|
||||
{ os: "windows", shouldHaveValue: true },
|
||||
{ os: "linux", shouldHaveValue: false },
|
||||
],
|
||||
},
|
||||
{
|
||||
kind: "tmp",
|
||||
runtime: [
|
||||
{ os: "mac", shouldHaveValue: true },
|
||||
{ os: "win", shouldHaveValue: true },
|
||||
{ os: "darwin", shouldHaveValue: true },
|
||||
{ os: "windows", shouldHaveValue: true },
|
||||
{ os: "linux", shouldHaveValue: true },
|
||||
],
|
||||
},
|
||||
{
|
||||
kind: "video",
|
||||
runtime: [
|
||||
{ os: "mac", shouldHaveValue: true },
|
||||
{ os: "win", shouldHaveValue: true },
|
||||
{ os: "darwin", shouldHaveValue: true },
|
||||
{ os: "windows", shouldHaveValue: true },
|
||||
{ os: "linux", shouldHaveValue: false },
|
||||
],
|
||||
},
|
||||
|
|
|
@ -49,7 +49,7 @@ unitTest(
|
|||
unitTest(
|
||||
{
|
||||
// No signals on windows.
|
||||
ignore: Deno.build.os === "win",
|
||||
ignore: Deno.build.os === "windows",
|
||||
perms: { run: true },
|
||||
},
|
||||
async function runCommandFailedWithSignal(): Promise<void> {
|
||||
|
@ -318,7 +318,7 @@ unitTest({ perms: { run: true } }, async function runClose(): Promise<void> {
|
|||
});
|
||||
|
||||
unitTest(function signalNumbers(): void {
|
||||
if (Deno.build.os === "mac") {
|
||||
if (Deno.build.os === "darwin") {
|
||||
assertEquals(Deno.Signal.SIGSTOP, 17);
|
||||
} else if (Deno.build.os === "linux") {
|
||||
assertEquals(Deno.Signal.SIGSTOP, 19);
|
||||
|
@ -326,7 +326,7 @@ unitTest(function signalNumbers(): void {
|
|||
});
|
||||
|
||||
// Ignore signal tests on windows for now...
|
||||
if (Deno.build.os !== "win") {
|
||||
if (Deno.build.os !== "windows") {
|
||||
unitTest(function killPermissions(): void {
|
||||
let caughtError = false;
|
||||
try {
|
||||
|
|
|
@ -10,7 +10,7 @@ unitTest(
|
|||
Deno.mkdirSync(target);
|
||||
// TODO Add test for Windows once symlink is implemented for Windows.
|
||||
// See https://github.com/denoland/deno/issues/815.
|
||||
if (Deno.build.os !== "win") {
|
||||
if (Deno.build.os !== "windows") {
|
||||
Deno.symlinkSync(target, symlink);
|
||||
const targetPath = Deno.readlinkSync(symlink);
|
||||
assertEquals(targetPath, target);
|
||||
|
@ -51,7 +51,7 @@ unitTest(
|
|||
Deno.mkdirSync(target);
|
||||
// TODO Add test for Windows once symlink is implemented for Windows.
|
||||
// See https://github.com/denoland/deno/issues/815.
|
||||
if (Deno.build.os !== "win") {
|
||||
if (Deno.build.os !== "windows") {
|
||||
Deno.symlinkSync(target, symlink);
|
||||
const targetPath = await Deno.readlink(symlink);
|
||||
assertEquals(targetPath, target);
|
||||
|
|
|
@ -4,7 +4,7 @@ import { unitTest, assert } from "./test_util.ts";
|
|||
unitTest({ perms: { read: true } }, function realpathSyncSuccess(): void {
|
||||
const incompletePath = "cli/tests/fixture.json";
|
||||
const realPath = Deno.realpathSync(incompletePath);
|
||||
if (Deno.build.os !== "win") {
|
||||
if (Deno.build.os !== "windows") {
|
||||
assert(realPath.startsWith("/"));
|
||||
} else {
|
||||
assert(/^[A-Z]/.test(realPath));
|
||||
|
@ -14,7 +14,7 @@ unitTest({ perms: { read: true } }, function realpathSyncSuccess(): void {
|
|||
|
||||
unitTest(
|
||||
{
|
||||
ignore: Deno.build.os === "win",
|
||||
ignore: Deno.build.os === "windows",
|
||||
perms: { read: true, write: true },
|
||||
},
|
||||
function realpathSyncSymlink(): void {
|
||||
|
@ -56,7 +56,7 @@ unitTest({ perms: { read: true } }, async function realpathSuccess(): Promise<
|
|||
> {
|
||||
const incompletePath = "cli/tests/fixture.json";
|
||||
const realPath = await Deno.realpath(incompletePath);
|
||||
if (Deno.build.os !== "win") {
|
||||
if (Deno.build.os !== "windows") {
|
||||
assert(realPath.startsWith("/"));
|
||||
} else {
|
||||
assert(/^[A-Z]/.test(realPath));
|
||||
|
@ -66,7 +66,7 @@ unitTest({ perms: { read: true } }, async function realpathSuccess(): Promise<
|
|||
|
||||
unitTest(
|
||||
{
|
||||
ignore: Deno.build.os === "win",
|
||||
ignore: Deno.build.os === "windows",
|
||||
perms: { read: true, write: true },
|
||||
},
|
||||
async function realpathSymlink(): Promise<void> {
|
||||
|
|
|
@ -90,7 +90,7 @@ unitTest(
|
|||
} catch (err) {
|
||||
errOnWindows = err;
|
||||
}
|
||||
if (Deno.build.os === "win") {
|
||||
if (Deno.build.os === "windows") {
|
||||
assertEquals(errOnWindows.message, "not implemented");
|
||||
} else {
|
||||
const pathInfo = Deno.lstatSync(danglingSymlinkPath);
|
||||
|
@ -123,7 +123,7 @@ unitTest(
|
|||
} catch (err) {
|
||||
errOnWindows = err;
|
||||
}
|
||||
if (Deno.build.os === "win") {
|
||||
if (Deno.build.os === "windows") {
|
||||
assertEquals(errOnWindows.message, "not implemented");
|
||||
} else {
|
||||
const symlinkPathInfo = Deno.statSync(validSymlinkPath);
|
||||
|
@ -326,7 +326,7 @@ unitTest(
|
|||
} catch (e) {
|
||||
errOnWindows = e;
|
||||
}
|
||||
if (Deno.build.os === "win") {
|
||||
if (Deno.build.os === "windows") {
|
||||
assertEquals(errOnWindows.message, "not implemented");
|
||||
} else {
|
||||
const pathInfo = Deno.lstatSync(danglingSymlinkPath);
|
||||
|
@ -359,7 +359,7 @@ unitTest(
|
|||
} catch (e) {
|
||||
errOnWindows = e;
|
||||
}
|
||||
if (Deno.build.os === "win") {
|
||||
if (Deno.build.os === "windows") {
|
||||
assertEquals(errOnWindows.message, "not implemented");
|
||||
} else {
|
||||
const symlinkPathInfo = Deno.statSync(validSymlinkPath);
|
||||
|
|
|
@ -22,7 +22,7 @@ function assertFile(path: string): void {
|
|||
function assertDirectory(path: string, mode?: number): void {
|
||||
const info = Deno.lstatSync(path);
|
||||
assert(info.isDirectory);
|
||||
if (Deno.build.os !== "win" && mode !== undefined) {
|
||||
if (Deno.build.os !== "windows" && mode !== undefined) {
|
||||
assertEquals(info.mode! & 0o777, mode & ~Deno.umask());
|
||||
}
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ function writeFileString(filename: string, s: string): void {
|
|||
}
|
||||
|
||||
unitTest(
|
||||
{ ignore: Deno.build.os === "win", perms: { read: true, write: true } },
|
||||
{ ignore: Deno.build.os === "windows", perms: { read: true, write: true } },
|
||||
function renameSyncErrorsUnix(): void {
|
||||
const testDir = Deno.makeTempDirSync();
|
||||
const oldfile = testDir + "/oldfile";
|
||||
|
@ -173,7 +173,7 @@ unitTest(
|
|||
);
|
||||
|
||||
unitTest(
|
||||
{ ignore: Deno.build.os !== "win", perms: { read: true, write: true } },
|
||||
{ ignore: Deno.build.os !== "windows", perms: { read: true, write: true } },
|
||||
function renameSyncErrorsWin(): void {
|
||||
const testDir = Deno.makeTempDirSync();
|
||||
const oldfile = testDir + "/oldfile";
|
||||
|
|
|
@ -14,7 +14,7 @@ function defer(n: number): Promise<void> {
|
|||
}
|
||||
|
||||
unitTest(
|
||||
{ ignore: Deno.build.os !== "win" },
|
||||
{ ignore: Deno.build.os !== "windows" },
|
||||
function signalsNotImplemented(): void {
|
||||
assertThrows(
|
||||
() => {
|
||||
|
@ -104,7 +104,7 @@ unitTest(
|
|||
);
|
||||
|
||||
unitTest(
|
||||
{ ignore: Deno.build.os === "win", perms: { run: true, net: true } },
|
||||
{ ignore: Deno.build.os === "windows", perms: { run: true, net: true } },
|
||||
async function signalStreamTest(): Promise<void> {
|
||||
const resolvable = createResolvable();
|
||||
// This prevents the program from exiting.
|
||||
|
@ -135,7 +135,7 @@ unitTest(
|
|||
);
|
||||
|
||||
unitTest(
|
||||
{ ignore: Deno.build.os === "win", perms: { run: true } },
|
||||
{ ignore: Deno.build.os === "windows", perms: { run: true } },
|
||||
async function signalPromiseTest(): Promise<void> {
|
||||
const resolvable = createResolvable();
|
||||
// This prevents the program from exiting.
|
||||
|
@ -155,7 +155,7 @@ unitTest(
|
|||
);
|
||||
|
||||
unitTest(
|
||||
{ ignore: Deno.build.os === "win", perms: { run: true } },
|
||||
{ ignore: Deno.build.os === "windows", perms: { run: true } },
|
||||
function signalShorthandsTest(): void {
|
||||
let s: Deno.SignalStream;
|
||||
s = Deno.signals.alarm(); // for SIGALRM
|
||||
|
|
|
@ -193,7 +193,7 @@ unitTest({ perms: { read: true } }, async function lstatNotFound(): Promise<
|
|||
});
|
||||
|
||||
unitTest(
|
||||
{ ignore: Deno.build.os !== "win", perms: { read: true, write: true } },
|
||||
{ ignore: Deno.build.os !== "windows", perms: { read: true, write: true } },
|
||||
function statNoUnixFields(): void {
|
||||
const enc = new TextEncoder();
|
||||
const data = enc.encode("Hello");
|
||||
|
@ -214,7 +214,7 @@ unitTest(
|
|||
);
|
||||
|
||||
unitTest(
|
||||
{ ignore: Deno.build.os === "win", perms: { read: true, write: true } },
|
||||
{ ignore: Deno.build.os === "windows", perms: { read: true, write: true } },
|
||||
function statUnixFields(): void {
|
||||
const enc = new TextEncoder();
|
||||
const data = enc.encode("Hello");
|
||||
|
|
|
@ -16,7 +16,7 @@ unitTest(
|
|||
errOnWindows = e;
|
||||
}
|
||||
if (errOnWindows) {
|
||||
assertEquals(Deno.build.os, "win");
|
||||
assertEquals(Deno.build.os, "windows");
|
||||
assertEquals(errOnWindows.message, "not implemented");
|
||||
} else {
|
||||
const newNameInfoLStat = Deno.lstatSync(newname);
|
||||
|
@ -53,7 +53,7 @@ unitTest(
|
|||
err = e;
|
||||
}
|
||||
if (err) {
|
||||
assertEquals(Deno.build.os, "win");
|
||||
assertEquals(Deno.build.os, "windows");
|
||||
// from cli/js/util.ts:notImplemented
|
||||
assertEquals(err.message, "not implemented");
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ import { unitTest, assertEquals } from "./test_util.ts";
|
|||
|
||||
unitTest(
|
||||
{
|
||||
ignore: Deno.build.os === "win",
|
||||
ignore: Deno.build.os === "windows",
|
||||
},
|
||||
function umaskSuccess(): void {
|
||||
const prevMask = Deno.umask(0o020);
|
||||
|
|
|
@ -48,7 +48,7 @@ unitTest({ perms: { write: false } }, function writeFileSyncPerm(): void {
|
|||
unitTest(
|
||||
{ perms: { read: true, write: true } },
|
||||
function writeFileSyncUpdateMode(): void {
|
||||
if (Deno.build.os !== "win") {
|
||||
if (Deno.build.os !== "windows") {
|
||||
const enc = new TextEncoder();
|
||||
const data = enc.encode("Hello");
|
||||
const filename = Deno.makeTempDirSync() + "/test.txt";
|
||||
|
@ -164,7 +164,7 @@ unitTest(
|
|||
unitTest(
|
||||
{ perms: { read: true, write: true } },
|
||||
async function writeFileUpdateMode(): Promise<void> {
|
||||
if (Deno.build.os !== "win") {
|
||||
if (Deno.build.os !== "windows") {
|
||||
const enc = new TextEncoder();
|
||||
const data = enc.encode("Hello");
|
||||
const filename = Deno.makeTempDirSync() + "/test.txt";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue