diff options
author | Kevin (Kun) "Kassimo" Qian <kevinkassimo@gmail.com> | 2018-10-03 15:11:38 -0700 |
---|---|---|
committer | Bert Belder <bertbelder@gmail.com> | 2018-10-03 16:22:32 -0700 |
commit | 3c080ca39abff28ed2cc6ac618558cced9c2e842 (patch) | |
tree | 2e47978f84b54fa5a5863c41f75e4f9c537b0b18 | |
parent | 47508c72071d8e4655da5601585dc1c988d34850 (diff) |
Reenable copyFile tests
-rw-r--r-- | js/copy_file_test.ts | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/js/copy_file_test.ts b/js/copy_file_test.ts index a5ae44a59..695d9b8c9 100644 --- a/js/copy_file_test.ts +++ b/js/copy_file_test.ts @@ -31,7 +31,6 @@ testPerm({ write: true }, function copyFileSyncSuccess() { assertSameContent(fromFilename, toFilename); }); -/* Test is incorrect. TODO: fix this test. testPerm({ write: true }, function copyFileSyncFailure() { const tempDir = deno.makeTempDirSync(); const fromFilename = tempDir + "/from.txt"; @@ -44,11 +43,16 @@ testPerm({ write: true }, function copyFileSyncFailure() { err = e; } assert(!!err); - // Rust deem non-existent path as invalid input - assertEqual(err.kind, deno.ErrorKind.InvalidInput); - assertEqual(err.name, "InvalidInput"); + 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"); + } }); -*/ testPerm({ write: true }, function copyFileSyncOverwrite() { const tempDir = deno.makeTempDirSync(); @@ -88,7 +92,6 @@ testPerm({ write: true }, async function copyFileSuccess() { assertSameContent(fromFilename, toFilename); }); -/* Test is incorrect. TODO: fix this test. testPerm({ write: true }, async function copyFileFailure() { const tempDir = deno.makeTempDirSync(); const fromFilename = tempDir + "/from.txt"; @@ -101,11 +104,16 @@ testPerm({ write: true }, async function copyFileFailure() { err = e; } assert(!!err); - // Rust deem non-existent path as invalid input - assertEqual(err.kind, deno.ErrorKind.InvalidInput); - assertEqual(err.name, "InvalidInput"); + 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"); + } }); -*/ testPerm({ write: true }, async function copyFileOverwrite() { const tempDir = deno.makeTempDirSync(); |