From 9bea576f3ea224ec72f371f6f0bc582171ca7890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Sabiniarz?= <31597105+mhvsa@users.noreply.github.com> Date: Fri, 7 Jun 2019 02:51:04 +0100 Subject: Deno.core.evalContext & Deno.core.print fix (#2465) --- core/libdeno/libdeno_test.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'core/libdeno/libdeno_test.js') diff --git a/core/libdeno/libdeno_test.js b/core/libdeno/libdeno_test.js index 156af1e47..17a6343cf 100644 --- a/core/libdeno/libdeno_test.js +++ b/core/libdeno/libdeno_test.js @@ -195,3 +195,27 @@ global.LibDenoEvalContextError = () => { assert(!errInfo5.isCompileError); // is NOT a compilation error! (just eval) assert(errInfo5.thrown.message === "Unexpected end of input"); }; + +global.LibDenoEvalContextInvalidArgument = () => { + try { + Deno.core.evalContext(); + } catch (e) { + assert(e instanceof TypeError); + assert(e.message === "Invalid Argument"); + } +}; + +global.LibDenoPrintInvalidArgument = () => { + try { + Deno.core.print(); + } catch (e) { + assert(e instanceof TypeError); + assert(e.message === "Invalid Argument"); + } + try { + Deno.core.print(2, 3, 4); + } catch (e) { + assert(e instanceof TypeError); + assert(e.message === "Invalid Argument"); + } +}; -- cgit v1.2.3