jsOMS/tests/Math/MathProcessorTest.js
Dennis Eichhorn 7b75ec58f7
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
CI / general_module_workflow_js (push) Has been cancelled
fix permissions
2025-04-02 14:15:07 +00:00

17 lines
614 B
JavaScript

import { MathProcessor } from '../../Math/MathProcessor.js';
describe('MathProcessorTest', function ()
{
'use strict';
describe('testBasicEvaluation', function ()
{
it('Testing formula evaluation', function ()
{
expect(MathProcessor.mathEvaluate('3 + 4 * 2 / ( 1 - 5 ) ^ 2 ^ 3 + 1.5')).toBeCloseTo(4.5, 2);
expect(MathProcessor.mathEvaluate('3+4*2/(1-5)^2^3+1.5')).toBeCloseTo(4.5, 2);
expect(MathProcessor.mathEvaluate('invalid')).toBe(null);
expect(MathProcessor.mathEvaluate('3+4*2/(1-5^2^3+1.5')).toBe(null);
});
});
});