mirror of
https://github.com/zoriya/v10.git
synced 2026-08-11 16:40:27 +00:00
feat(spf): HLS engine composition walkthrough + doc-driven cleanups (#1512)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
17d44a5d32
commit
0cfd3bb395
@@ -0,0 +1,44 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { generateId } from '../generate-id';
|
||||
|
||||
describe('generateId', () => {
|
||||
it('generates a string ID', () => {
|
||||
const id = generateId();
|
||||
|
||||
expect(typeof id).toBe('string');
|
||||
});
|
||||
|
||||
it('generates unique IDs', () => {
|
||||
const id1 = generateId();
|
||||
const id2 = generateId();
|
||||
const id3 = generateId();
|
||||
|
||||
expect(id1).not.toBe(id2);
|
||||
expect(id2).not.toBe(id3);
|
||||
expect(id1).not.toBe(id3);
|
||||
});
|
||||
|
||||
it('generates IDs without decimals', () => {
|
||||
const id = generateId();
|
||||
|
||||
expect(id).not.toMatch(/\./);
|
||||
});
|
||||
|
||||
it('generates IDs in consistent format', () => {
|
||||
const id = generateId();
|
||||
|
||||
// Should be timestamp-random format
|
||||
expect(id).toMatch(/^\d+-\d+$/);
|
||||
});
|
||||
|
||||
it('generates different IDs in rapid succession', () => {
|
||||
const ids = new Set<string>();
|
||||
|
||||
for (let i = 0; i < 100; i++) {
|
||||
ids.add(generateId());
|
||||
}
|
||||
|
||||
// All should be unique
|
||||
expect(ids.size).toBe(100);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user