mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 02:48:24 +00:00
perf(ext/console): break on iterableLimit & better sparse array handling (#15935)
This commit is contained in:
parent
9a9dd12253
commit
b73cb7bf9c
2 changed files with 136 additions and 42 deletions
|
@ -759,7 +759,54 @@ Deno.test(function consoleTestStringifyIterable() {
|
|||
`[ <4 empty items>, 0, 0, <4 empty items> ]`,
|
||||
);
|
||||
|
||||
/* TODO(ry) Fix this test
|
||||
const emptyArray = Array(5000);
|
||||
assertEquals(
|
||||
stringify(emptyArray),
|
||||
`[ <5000 empty items> ]`,
|
||||
);
|
||||
|
||||
assertEquals(
|
||||
stringify(Array(1)),
|
||||
`[ <1 empty item> ]`,
|
||||
);
|
||||
|
||||
const withEmptyElAndMoreItems = Array(500);
|
||||
withEmptyElAndMoreItems.fill(0, 50, 80);
|
||||
withEmptyElAndMoreItems.fill(2, 100, 120);
|
||||
withEmptyElAndMoreItems.fill(3, 140, 160);
|
||||
withEmptyElAndMoreItems.fill(4, 180);
|
||||
assertEquals(
|
||||
stringify(withEmptyElAndMoreItems),
|
||||
`[
|
||||
<50 empty items>, 0, 0, 0,
|
||||
0, 0, 0, 0,
|
||||
0, 0, 0, 0,
|
||||
0, 0, 0, 0,
|
||||
0, 0, 0, 0,
|
||||
0, 0, 0, 0,
|
||||
0, 0, 0, 0,
|
||||
0, 0, 0, <20 empty items>,
|
||||
2, 2, 2, 2,
|
||||
2, 2, 2, 2,
|
||||
2, 2, 2, 2,
|
||||
2, 2, 2, 2,
|
||||
2, 2, 2, 2,
|
||||
<20 empty items>, 3, 3, 3,
|
||||
3, 3, 3, 3,
|
||||
3, 3, 3, 3,
|
||||
3, 3, 3, 3,
|
||||
3, 3, 3, 3,
|
||||
3, <20 empty items>, 4, 4,
|
||||
4, 4, 4, 4,
|
||||
4, 4, 4, 4,
|
||||
4, 4, 4, 4,
|
||||
4, 4, 4, 4,
|
||||
4, 4, 4, 4,
|
||||
4, 4, 4, 4,
|
||||
... 294 more items
|
||||
]`,
|
||||
);
|
||||
|
||||
const lWithEmptyEl = Array(200);
|
||||
lWithEmptyEl.fill(0, 50, 80);
|
||||
assertEquals(
|
||||
|
@ -776,9 +823,8 @@ Deno.test(function consoleTestStringifyIterable() {
|
|||
0, 0, 0,
|
||||
0, 0, 0,
|
||||
0, <120 empty items>
|
||||
]`
|
||||
]`,
|
||||
);
|
||||
*/
|
||||
});
|
||||
|
||||
Deno.test(function consoleTestStringifyIterableWhenGrouped() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue