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,
|
||||
renameSync,
|
||||
statSync,
|
||||
lStatSync,
|
||||
lstatSync,
|
||||
writeFileSync
|
||||
} from "./os";
|
||||
export { libdeno } from "./libdeno";
|
||||
|
|
2
js/os.ts
2
js/os.ts
|
@ -277,7 +277,7 @@ export class FileInfo {
|
|||
* be returned.
|
||||
* @returns FileInfo
|
||||
*/
|
||||
export function lStatSync(filename: string): FileInfo {
|
||||
export function lstatSync(filename: string): FileInfo {
|
||||
return statSyncInner(filename, true);
|
||||
}
|
||||
|
||||
|
|
|
@ -56,26 +56,26 @@ test(async function statSyncNotFound() {
|
|||
assertEqual(badInfo, undefined);
|
||||
});
|
||||
|
||||
test(async function lStatSyncSuccess() {
|
||||
const packageInfo = deno.lStatSync("package.json");
|
||||
test(async function lstatSyncSuccess() {
|
||||
const packageInfo = deno.lstatSync("package.json");
|
||||
assert(packageInfo.isFile());
|
||||
assert(!packageInfo.isSymlink());
|
||||
|
||||
const testingInfo = deno.lStatSync("testing");
|
||||
const testingInfo = deno.lstatSync("testing");
|
||||
assert(!testingInfo.isDirectory());
|
||||
assert(testingInfo.isSymlink());
|
||||
|
||||
const srcInfo = deno.lStatSync("src");
|
||||
const srcInfo = deno.lstatSync("src");
|
||||
assert(srcInfo.isDirectory());
|
||||
assert(!srcInfo.isSymlink());
|
||||
});
|
||||
|
||||
test(async function lStatSyncNotFound() {
|
||||
test(async function lstatSyncNotFound() {
|
||||
let caughtError = false;
|
||||
let badInfo;
|
||||
|
||||
try {
|
||||
badInfo = deno.lStatSync("bad_file_name");
|
||||
badInfo = deno.lstatSync("bad_file_name");
|
||||
} catch (err) {
|
||||
caughtError = true;
|
||||
// TODO assert(err instanceof deno.NotFound).
|
||||
|
|
Loading…
Reference in a new issue