fix: Deno.remove() to properly remove dangling symlinks (#3860)

For some reason, the unit tests for Deno.remove() were not being imported to 
unit_tests.ts and, consequently, not being executed. Thus, I imported them, 
refactored some existent ones and wrote new ones for the symlink removal case.

Since the creation of a symlink is not implemented for Windows yet, assertions
that consider this state were added when the tests are executed in this OS.
This commit is contained in:
Rafael Vargas 2020-02-03 10:20:15 -03:00 committed by GitHub
parent f168597b7a
commit 55063dd8e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 277 additions and 126 deletions

View file

@ -6,7 +6,7 @@ export interface RemoveOption {
recursive?: boolean;
}
/** Removes the named file or directory synchronously. Would throw
/** Removes the named file, directory or symlink synchronously. Would throw
* error if permission denied, not found, or directory not empty if `recursive`
* set to false.
* `recursive` is set to false by default.
@ -17,7 +17,7 @@ export function removeSync(path: string, options: RemoveOption = {}): void {
sendSync(dispatch.OP_REMOVE, { path, recursive: !!options.recursive });
}
/** Removes the named file or directory. Would throw error if
/** Removes the named file, directory or symlink. Would throw error if
* permission denied, not found, or directory not empty if `recursive` set
* to false.
* `recursive` is set to false by default.