Files
copilot/tests/acceptance/2/criteria.test.js
3c4b6c950e8bf72399a3f54c7141ed8c487a9daf 86f1b15f65
All checks were successful
elffuss/validation Validation passed
Solution 0x9bbf3d4e157125d83761eb972cc5eb0beb0e75e4fd78cc894d54a7a94b20965d
T2T-Item: 0x9bbf3d4e157125d83761eb972cc5eb0beb0e75e4fd78cc894d54a7a94b20965d
T2T-Issue: 0xc0ae452fd36bac337ec3f451e6383702e4d49a1fb1113ea26024dff8f4d296c1
2026-10-02 14:29:00 +00:00

14 lines
525 B
JavaScript

import test from 'node:test';
import assert from 'node:assert/strict';
const mod = await import('../../../diarize.mjs');
test('criterion 1', () => {
assert.throws(() => mod.cosine([1, 2, 3], [1, 2]), (err) => err instanceof Error && err.message.startsWith('cosine:'));
assert.equal(mod.cosine([1, 0], [1, 0]), 1);
});
test('criterion 2', () => {
assert.throws(() => mod.cosine([1, 0], [1, 0, 5]), (err) => err instanceof Error && err.message.startsWith('cosine:'));
assert.equal(mod.cosine([0, 0], [0, 0]), 0);
});