diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2020-07-14 15:24:17 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-14 15:24:17 -0400 |
commit | cde4dbb35132848ffece59ef9cfaccff32347124 (patch) | |
tree | cc7830968c6decde704c8cfb83c9185193dc698f /std/fmt/printf_test.ts | |
parent | 9eca71caa1674c31f9cc5d4e86c03f10b59e0a00 (diff) |
Use dprint for internal formatting (#6682)
Diffstat (limited to 'std/fmt/printf_test.ts')
-rw-r--r-- | std/fmt/printf_test.ts | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/std/fmt/printf_test.ts b/std/fmt/printf_test.ts index a10fdf516..54adc8b55 100644 --- a/std/fmt/printf_test.ts +++ b/std/fmt/printf_test.ts @@ -35,19 +35,19 @@ Deno.test("testIntegerB", function (): void { assertEquals(S("%b", -4), "-100"); assertEquals( S("%b", 4.1), - "100.0001100110011001100110011001100110011001100110011" + "100.0001100110011001100110011001100110011001100110011", ); assertEquals( S("%b", -4.1), - "-100.0001100110011001100110011001100110011001100110011" + "-100.0001100110011001100110011001100110011001100110011", ); assertEquals( S("%b", Number.MAX_SAFE_INTEGER), - "11111111111111111111111111111111111111111111111111111" + "11111111111111111111111111111111111111111111111111111", ); assertEquals( S("%b", Number.MIN_SAFE_INTEGER), - "-11111111111111111111111111111111111111111111111111111" + "-11111111111111111111111111111111111111111111111111111", ); // width @@ -137,18 +137,18 @@ Deno.test("testFloatfF", function (): void { assertEquals( S("%.324f", Number.MIN_VALUE), // eslint-disable-next-line max-len - "0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005" + "0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005", ); assertEquals(S("%F", Number.MIN_VALUE), "0.000000"); assertEquals( S("%f", Number.MAX_VALUE), // eslint-disable-next-line max-len - "179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000" + "179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000", ); assertEquals( S("%F", Number.MAX_VALUE), // eslint-disable-next-line max-len - "179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000" + "179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000", ); }); @@ -190,7 +190,7 @@ Deno.test("testWidthAndPrecision", function (): void { assertEquals( S("%9.99d", 9), // eslint-disable-next-line max-len - "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009" + "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009", ); assertEquals(S("%1.12d", 9), "000000000009"); assertEquals(S("%2s", "a"), " a"); @@ -200,12 +200,12 @@ Deno.test("testWidthAndPrecision", function (): void { assertEquals( S("%*.99d", 9, 9), // eslint-disable-next-line max-len - "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009" + "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009", ); assertEquals( S("%9.*d", 99, 9), // eslint-disable-next-line max-len - "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009" + "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009", ); assertEquals(S("%*s", 2, "a"), " a"); assertEquals(S("%*d", 2, 1), " 1"); @@ -591,7 +591,7 @@ Deno.test("testThorough", function (): void { assertEquals( is, should, - `failed case[${i}] : is >${is}< should >${should}<` + `failed case[${i}] : is >${is}< should >${should}<`, ); }); }); @@ -600,7 +600,7 @@ Deno.test("testWeirdos", function (): void { assertEquals(S("%.d", 9), "9"); assertEquals( S("dec[%d]=%d hex[%[1]d]=%#x oct[%[1]d]=%#o %s", 1, 255, "Third"), - "dec[1]=255 hex[1]=0xff oct[1]=0377 Third" + "dec[1]=255 hex[1]=0xff oct[1]=0377 Third", ); }); @@ -610,7 +610,7 @@ Deno.test("formatV", function (): void { assertEquals(S("%#v", a), `{ a: { a: { a: { a: ${cyan("[Object]")} } } } }`); assertEquals( S("%#.8v", a), - "{ a: { a: { a: { a: { a: { a: { a: {} } } } } } } }" + "{ a: { a: { a: { a: { a: { a: { a: {} } } } } } } }", ); assertEquals(S("%#.1v", a), `{ a: ${cyan("[Object]")} }`); }); @@ -625,9 +625,9 @@ Deno.test("flagLessThan", function (): void { const aArray = [a, a, a]; assertEquals( S("%<#.1v", aArray), - `[ { a: ${cyan("[Object]")} }, { a: ${cyan("[Object]")} }, { a: ${cyan( - "[Object]" - )} } ]` + `[ { a: ${cyan("[Object]")} }, { a: ${cyan("[Object]")} }, { a: ${ + cyan("[Object]") + } } ]`, ); const fArray = [1.2345, 0.98765, 123456789.5678]; assertEquals(S("%<.2f", fArray), "[ 1.23, 0.99, 123456789.57 ]"); @@ -649,7 +649,7 @@ Deno.test("testErrors", function (): void { assertEquals(S("%.*f", "a", 1.1), "%!(BAD PREC 'a')"); assertEquals( S("%.[2]*f", 1.23, "p"), - `%!(BAD PREC 'p')%!(EXTRA '${yellow("1.23")}')` + `%!(BAD PREC 'p')%!(EXTRA '${yellow("1.23")}')`, ); assertEquals(S("%.[2]*[1]f Yippie!", 1.23, "p"), "%!(BAD PREC 'p') Yippie!"); @@ -663,7 +663,7 @@ Deno.test("testErrors", function (): void { assertEquals(S("%[hallo]s %d %d %d", 1, 2, 3, 4), "%!(BAD INDEX) 2 3 4"); assertEquals( S("%[5]s", 1, 2, 3, 4), - `%!(BAD INDEX)%!(EXTRA '${yellow("2")}' '${yellow("3")}' '${yellow("4")}')` + `%!(BAD INDEX)%!(EXTRA '${yellow("2")}' '${yellow("3")}' '${yellow("4")}')`, ); assertEquals(S("%[5]f"), "%!(BAD INDEX)"); assertEquals(S("%.[5]f"), "%!(BAD INDEX)"); |