feat:移除了弹窗,服务器添加sls

This commit is contained in:
AxTps committed 2026-09-08 22:39:45 +08:00
commit 6a295f9a7a
4082 files changed
+1322534

No files matched your search

@@ -0,0 +1,31 @@
import assert from 'node:assert/strict'
import test from 'node:test'
import { ServerConsoleBuffer } from './server-console-buffer.ts'
test('bounds buffered console output without rescanning prior chunks', () => {
const buffer = new ServerConsoleBuffer(5)
buffer.push(Uint8Array.from([1, 2]))
buffer.push(Uint8Array.from([3, 4]))
buffer.push(Uint8Array.from([5, 6]))
assert.equal(buffer.size, 4)
assert.deepEqual(
[...buffer.values()].map((chunk) => [...chunk]),
[
[3, 4],
[5, 6],
],
)
})
test('keeps only the tail of a chunk larger than the capacity', () => {
const buffer = new ServerConsoleBuffer(3)
buffer.push(Uint8Array.from([1, 2, 3, 4, 5]))
assert.equal(buffer.size, 3)
assert.deepEqual(
[...buffer.values()].map((chunk) => [...chunk]),
[[3, 4, 5]],
)
})