mirror of
https://github.com/multipleof4/lynchmark.git
synced 2026-01-13 16:17:54 +00:00
Revert: Update test.js
This commit is contained in:
@@ -5,16 +5,14 @@ export default {
|
|||||||
// - You MUST use a dynamic import() to load the 'mathjs' library from a CDN.
|
// - You MUST use a dynamic import() to load the 'mathjs' library from a CDN.
|
||||||
// - You MUST use the library's built-in 'det' function to perform the calculation.
|
// - You MUST use the library's built-in 'det' function to perform the calculation.
|
||||||
// - The function should return the determinant value.`,
|
// - The function should return the determinant value.`,
|
||||||
getTestCases: () => {
|
|
||||||
const matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
|
|
||||||
return [matrix];
|
|
||||||
},
|
|
||||||
runTest: async (calculateDeterminant) => {
|
runTest: async (calculateDeterminant) => {
|
||||||
const assert = {
|
const assert = {
|
||||||
strictEqual: (a, e, m) => { if (a !== e) throw new Error(m || `FAIL: ${a} !== ${e}`) },
|
strictEqual: (a, e, m) => { if (a !== e) throw new Error(m || `FAIL: ${a} !== ${e}`) },
|
||||||
};
|
};
|
||||||
const [matrix] = globalThis.getTestCases ? globalThis.getTestCases() : this.getTestCases();
|
const matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
|
||||||
const det = await calculateDeterminant(matrix);
|
const det = await calculateDeterminant(matrix);
|
||||||
assert.strictEqual(det, 0, "Test Failed: Determinant should be 0.");
|
assert.strictEqual(det, 0, "Test Failed: Determinant should be 0.");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user