Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { appendCompactedStringChunk, RETAINED_STRING_CHUNK_LIMIT } from './string-chunk-compaction'
|
||||
|
||||
describe('appendCompactedStringChunk', () => {
|
||||
it('preserves 100,000 fragments within the retained chunk limit', () => {
|
||||
const chunks: string[] = []
|
||||
let maxRetainedChunks = 0
|
||||
|
||||
for (let index = 0; index < 100_000; index += 1) {
|
||||
appendCompactedStringChunk(chunks, String.fromCharCode(97 + (index % 26)))
|
||||
maxRetainedChunks = Math.max(maxRetainedChunks, chunks.length)
|
||||
}
|
||||
|
||||
expect(maxRetainedChunks).toBeLessThanOrEqual(RETAINED_STRING_CHUNK_LIMIT)
|
||||
expect(chunks.join('')).toHaveLength(100_000)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user