mirror of
https://github.com/denoland/deno.git
synced 2024-10-29 08:58:01 -04:00
lStat -> lstat
This commit is contained in:
parent
641e3d404d
commit
d6c310596e
3 changed files with 8 additions and 8 deletions
|
@ -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";
|
||||||
|
|
2
js/os.ts
2
js/os.ts
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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).
|
||||||
|
|
Loading…
Reference in a new issue