Files
copilot/tests/acceptance/2/criteria.test.js
elffuss-bot f4ed249874 Apply item 0xa95f32ea for issue #2
Squash of the patch of item 0xa95f32ea03bfe95df656140edb88432fac22efa32917418f73d0f29ce155ecd0, final in the elffuss ledger.
Solver 0xeb104004d5d1c1f091d70119cbfe17b6370433f1; 2 approvals of round 0.

T2T-Item: 0xa95f32ea03bfe95df656140edb88432fac22efa32917418f73d0f29ce155ecd0
T2T-Issue: 0xc0ae452fd36bac337ec3f451e6383702e4d49a1fb1113ea26024dff8f4d296c1
T2T-Event: 0xb52e3d5f828c1af808612b98fd666596d74eba5a9b707c9b50edc4495e360024
2026-10-03 08:40:21 +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);
});