0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-29 08:58:01 -04:00

lStat -> lstat

This commit is contained in:
Ryan Dahl 2018-09-04 15:28:18 -04:00
parent 641e3d404d
commit d6c310596e
3 changed files with 8 additions and 8 deletions

View file

@ -10,7 +10,7 @@ export {
readFileSync, readFileSync,
renameSync, renameSync,
statSync, statSync,
lStatSync, lstatSync,
writeFileSync writeFileSync
} from "./os"; } from "./os";
export { libdeno } from "./libdeno"; export { libdeno } from "./libdeno";

View file

@ -277,7 +277,7 @@ export class FileInfo {
* be returned. * be returned.
* @returns FileInfo * @returns FileInfo
*/ */
export function lStatSync(filename: string): FileInfo { export function lstatSync(filename: string): FileInfo {
return statSyncInner(filename, true); return statSyncInner(filename, true);
} }

View file

@ -56,26 +56,26 @@ test(async function statSyncNotFound() {
assertEqual(badInfo, undefined); assertEqual(badInfo, undefined);
}); });
test(async function lStatSyncSuccess() { test(async function lstatSyncSuccess() {
const packageInfo = deno.lStatSync("package.json"); const packageInfo = deno.lstatSync("package.json");
assert(packageInfo.isFile()); assert(packageInfo.isFile());
assert(!packageInfo.isSymlink()); assert(!packageInfo.isSymlink());
const testingInfo = deno.lStatSync("testing"); const testingInfo = deno.lstatSync("testing");
assert(!testingInfo.isDirectory()); assert(!testingInfo.isDirectory());
assert(testingInfo.isSymlink()); assert(testingInfo.isSymlink());
const srcInfo = deno.lStatSync("src"); const srcInfo = deno.lstatSync("src");
assert(srcInfo.isDirectory()); assert(srcInfo.isDirectory());
assert(!srcInfo.isSymlink()); assert(!srcInfo.isSymlink());
}); });
test(async function lStatSyncNotFound() { test(async function lstatSyncNotFound() {
let caughtError = false; let caughtError = false;
let badInfo; let badInfo;
try { try {
badInfo = deno.lStatSync("bad_file_name"); badInfo = deno.lstatSync("bad_file_name");
} catch (err) { } catch (err) {
caughtError = true; caughtError = true;
// TODO assert(err instanceof deno.NotFound). // TODO assert(err instanceof deno.NotFound).