diff options
author | Leo Kettmeir <crowlkats@toaxl.com> | 2023-06-05 12:25:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-05 12:25:47 +0200 |
commit | 08bd23970dbce4ccf8103abf27e4cfa1b747705b (patch) | |
tree | 77c84c3e3484c94eafa4f62a0d3dd822e5c703bc /cli/tests | |
parent | 77a950aac417ba5e9bf1a48b0ec8934291376a8c (diff) |
feat: add more options to Deno.inspect (#19337)
For https://github.com/denoland/deno_std/issues/3404
---------
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/integration/lsp_tests.rs | 2 | ||||
-rw-r--r-- | cli/tests/unit/console_test.ts | 24 |
2 files changed, 25 insertions, 1 deletions
diff --git a/cli/tests/integration/lsp_tests.rs b/cli/tests/integration/lsp_tests.rs index eee83c4a2..fa8cb6a3c 100644 --- a/cli/tests/integration/lsp_tests.rs +++ b/cli/tests/integration/lsp_tests.rs @@ -4715,7 +4715,7 @@ fn lsp_completions_auto_import() { "source": "./b.ts", "data": { "exportName": "foo", - "exportMapKey": "foo|6810|file:///a/b", + "exportMapKey": "foo|6812|file:///a/b", "moduleSpecifier": "./b.ts", "fileName": "file:///a/b.ts" }, diff --git a/cli/tests/unit/console_test.ts b/cli/tests/unit/console_test.ts index c4f2f64a4..b177b956b 100644 --- a/cli/tests/unit/console_test.ts +++ b/cli/tests/unit/console_test.ts @@ -2278,3 +2278,27 @@ Deno.test(function inspectAnonymousFunctions() { "[AsyncGeneratorFunction (anonymous)]", ); }); + +Deno.test(function inspectBreakLengthOption() { + assertEquals( + Deno.inspect("123456789\n".repeat(3), { breakLength: 34 }), + `"123456789\\n123456789\\n123456789\\n"`, + ); + assertEquals( + Deno.inspect("123456789\n".repeat(3), { breakLength: 33 }), + `"123456789\\n" + + "123456789\\n" + + "123456789\\n"`, + ); +}); + +Deno.test(function inspectEscapeSequencesFalse() { + assertEquals( + Deno.inspect("foo\nbar", { escapeSequences: true }), + '"foo\\nbar"', + ); // default behavior + assertEquals( + Deno.inspect("foo\nbar", { escapeSequences: false }), + '"foo\nbar"', + ); +}); |