Solution 0x8f0c563f9b856c1260d72d24bcf08af92697fd1617558c23633d97ff7c761b73
All checks were successful
elffuss/validation Validation passed
All checks were successful
elffuss/validation Validation passed
T2T-Item: 0x8f0c563f9b856c1260d72d24bcf08af92697fd1617558c23633d97ff7c761b73 T2T-Issue: 0x98062380597bea3942e80b35090b356d0ac3e0e54c88cbbf251faa36758056f4
This commit is contained in:
30
tests/acceptance/1/CRITERIA.json
Normal file
30
tests/acceptance/1/CRITERIA.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"schema": "elffuss-t2t/criteria@2",
|
||||
"issue": 1,
|
||||
"criteria": [
|
||||
{
|
||||
"index": 1,
|
||||
"tests": [
|
||||
"tests/acceptance/1/criteria.test.js::criterion 1"
|
||||
]
|
||||
},
|
||||
{
|
||||
"index": 2,
|
||||
"tests": [
|
||||
"tests/acceptance/1/criteria.test.js::criterion 2"
|
||||
]
|
||||
},
|
||||
{
|
||||
"index": 3,
|
||||
"tests": [
|
||||
"tests/acceptance/1/criteria.test.js::criterion 3"
|
||||
]
|
||||
},
|
||||
{
|
||||
"index": 4,
|
||||
"tests": [
|
||||
"tests/acceptance/1/criteria.test.js::criterion 4"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
25
tests/acceptance/1/criteria.test.js
Normal file
25
tests/acceptance/1/criteria.test.js
Normal file
@@ -0,0 +1,25 @@
|
||||
import { test } from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
import { readFileSync } from 'node:fs'
|
||||
import * as mod from '../../../diarize.mjs' // the code under test: call it as mod.<name>(...)
|
||||
const source = readFileSync(new URL('../../../diarize.mjs', import.meta.url), 'utf8') // the text of diarize.mjs, for a criterion about how the file is written
|
||||
|
||||
test('criterion 1', () => {
|
||||
// `cosine([1, 2, 3], [1, 2])` throws an Error whose message starts with `cosine:`.
|
||||
assert.rejects(() => mod.cosine([1, 2, 3], [1, 2]), /cosine:/)
|
||||
})
|
||||
|
||||
test('criterion 2', () => {
|
||||
// `cosine([1, 0], [1, 0, 5])` throws an Error whose message starts with `cosine:`.
|
||||
assert.rejects(() => mod.cosine([1, 0], [1, 0, 5]), /cosine:/)
|
||||
})
|
||||
|
||||
test('criterion 3', () => {
|
||||
// `cosine([1, 0], [1, 0])` returns 1.
|
||||
assert.deepEqual(mod.cosine([1, 0], [1, 0]), 1)
|
||||
})
|
||||
|
||||
test('criterion 4', () => {
|
||||
// `cosine([0, 0], [0, 0])` returns 0.
|
||||
assert.deepEqual(mod.cosine([0, 0], [0, 0]), 0)
|
||||
})
|
||||
Reference in New Issue
Block a user