mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-21 21:47:18 +08:00
- puppeteer replaced with puppeteer-core (20.7.3). DevTools does not actually need puppeteer as it downloads the browsers on its own. PUPPETEER_SKIP_CHROMIUM_DOWNLOAD is not needed too. - @puppeteer/replay upgraded to 2.11.2 DISABLE_THIRD_PARTY_CHECK=requires code updates for puppeteer-core Bug: none Change-Id: I173c228d766681a1a8a9ada3fcf17525cd191726 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4640022 Reviewed-by: Simon Zünd <szuend@chromium.org> Commit-Queue: Randolf Jung <jrandolf@chromium.org>
63 lines
888 B
JavaScript
63 lines
888 B
JavaScript
const tape = require('tape')
|
|
const FIFO = require('./')
|
|
|
|
tape('basic', function (t) {
|
|
const q = new FIFO()
|
|
const values = [
|
|
1,
|
|
4,
|
|
4,
|
|
0,
|
|
null,
|
|
{},
|
|
Math.random(),
|
|
'',
|
|
'hello',
|
|
9,
|
|
1,
|
|
4,
|
|
5,
|
|
6,
|
|
7,
|
|
null,
|
|
null,
|
|
0,
|
|
0,
|
|
15,
|
|
52.2,
|
|
null
|
|
]
|
|
|
|
t.same(q.shift(), undefined)
|
|
t.ok(q.isEmpty())
|
|
t.equal(q.length, 0)
|
|
for (const value of values) q.push(value)
|
|
while (!q.isEmpty()) {
|
|
t.same(q.shift(), values.shift())
|
|
t.equal(q.length, values.length)
|
|
}
|
|
t.same(q.shift(), undefined)
|
|
t.ok(q.isEmpty())
|
|
t.end()
|
|
})
|
|
|
|
tape('long length', function (t) {
|
|
const q = new FIFO()
|
|
|
|
const len = 0x8f7
|
|
for (let i = 0; i < len; i++) q.push(i)
|
|
|
|
t.same(q.length, len)
|
|
|
|
let shifts = 0
|
|
while (!q.isEmpty()) {
|
|
q.shift()
|
|
shifts++
|
|
}
|
|
|
|
t.same(shifts, len)
|
|
t.same(q.length, 0)
|
|
|
|
t.end()
|
|
})
|