From 32f07971284f05993cf702aa589859e7900406b4 Mon Sep 17 00:00:00 2001 From: Jinho Bang Date: Wed, 17 Oct 2018 14:40:03 +0900 Subject: Fix a bug that copyFile reports different error codes This is a workaroud. Once the issue is resolved in Rust side, we should remove it. Fixes #895 --- js/copy_file_test.ts | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) (limited to 'js') diff --git a/js/copy_file_test.ts b/js/copy_file_test.ts index 695d9b8c9..05f0a6f71 100644 --- a/js/copy_file_test.ts +++ b/js/copy_file_test.ts @@ -43,15 +43,8 @@ testPerm({ write: true }, function copyFileSyncFailure() { err = e; } assert(!!err); - if (deno.platform.os === "win") { - assertEqual(err.kind, deno.ErrorKind.NotFound); - assertEqual(err.name, "NotFound"); - } else { - // On *nix, Rust deem non-existent path as invalid input - // See https://github.com/rust-lang/rust/issues/54800 - assertEqual(err.kind, deno.ErrorKind.InvalidInput); - assertEqual(err.name, "InvalidInput"); - } + assertEqual(err.kind, deno.ErrorKind.NotFound); + assertEqual(err.name, "NotFound"); }); testPerm({ write: true }, function copyFileSyncOverwrite() { @@ -104,15 +97,8 @@ testPerm({ write: true }, async function copyFileFailure() { err = e; } assert(!!err); - if (deno.platform.os === "win") { - assertEqual(err.kind, deno.ErrorKind.NotFound); - assertEqual(err.name, "NotFound"); - } else { - // On *nix, Rust deem non-existent path as invalid input - // See https://github.com/rust-lang/rust/issues/54800 - assertEqual(err.kind, deno.ErrorKind.InvalidInput); - assertEqual(err.name, "InvalidInput"); - } + assertEqual(err.kind, deno.ErrorKind.NotFound); + assertEqual(err.name, "NotFound"); }); testPerm({ write: true }, async function copyFileOverwrite() { -- cgit v1.2.3