From 38196f7850d7498e98f5ec7c66801deadabe09cf Mon Sep 17 00:00:00 2001 From: Casper Beyer Date: Fri, 18 Sep 2020 21:28:30 +0800 Subject: fix(cli/console): always quote and escape inspected strings (#7546) --- std/fmt/printf_test.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'std/fmt/printf_test.ts') diff --git a/std/fmt/printf_test.ts b/std/fmt/printf_test.ts index 54adc8b55..81e172f81 100644 --- a/std/fmt/printf_test.ts +++ b/std/fmt/printf_test.ts @@ -655,8 +655,14 @@ Deno.test("testErrors", function (): void { assertEquals(S("%[1]*.2f", "a", "p"), "%!(BAD WIDTH 'a')"); - assertEquals(S("A", "a", "p"), "A%!(EXTRA 'a' 'p')"); - assertEquals(S("%[2]s %[2]s", "a", "p"), "p p%!(EXTRA 'a')"); + assertEquals( + S("A", "a", "p"), + `A%!(EXTRA '\x1b[32m"a"\x1b[39m' '\x1b[32m"p"\x1b[39m')`, + ); + assertEquals( + S("%[2]s %[2]s", "a", "p"), + `p p%!(EXTRA '\x1b[32m"a"\x1b[39m')`, + ); // remains to be determined how to handle bad indices ... // (realistically) the entire error handling is still up for grabs. -- cgit v1.2.3