-
-
Notifications
You must be signed in to change notification settings - Fork 469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: formulas implemented #2496
Conversation
expect(result.getValue()).toBe(0); | ||
}); | ||
|
||
it('Value is array', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not remove any existing test cases
expect(result.getValue()).toBe(0); | ||
}); | ||
|
||
it('Value is array', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same above
import { ErrorType } from '../../../../basics/error-type'; | ||
import { ErrorValueObject } from '../../../../engine/value-object/base-value-object'; | ||
|
||
describe('Test acoth function', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to support tests for array formulas
import { ErrorType } from '../../../../basics/error-type'; | ||
import { ErrorValueObject } from '../../../../engine/value-object/base-value-object'; | ||
|
||
describe('Test asin function', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to support tests for array formulas
Please make sure all CI passes |
} | ||
|
||
// Assuming variant1 and variant2 can be arrays of different lengths | ||
let array1 = Array.isArray(variant1) ? variant1 : [variant1]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The row length and column lenth of two 2D arrays may be different. Both row and column need to be expanded to be consistent. You cannot just process the row length. Please refer to the usage of expandArrayValueObject
in the source code for expansion.
import { ErrorType } from '../../../../basics/error-type'; | ||
import { ErrorValueObject } from '../../../../engine/value-object/base-value-object'; | ||
|
||
describe('Test atan2 function', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no test for array parameters of different sizes. Multiple combinations are required, such as testing numbers and arrays, strings and arrays, numbers and strings, arrays and arrays, etc.
number1: { name: 'number1', detail: 'first' }, | ||
number2: { name: 'number2', detail: 'second' }, | ||
number1: { name: 'number1', detail: 'The real number for which you want to calculate the hyperbolic cosine.' }, | ||
number2: { name: 'number2', detail: 'Optional. A second real number.' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no second param
number1: { name: 'number1', detail: 'first' }, | ||
number2: { name: 'number2', detail: 'second' }, | ||
number1: { name: 'number1', detail: 'The angle in radians for which you want to calculate the cotangent.' }, | ||
number2: { name: 'number2', detail: 'Optional. A second angle.' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no second param
@@ -144,6 +144,7 @@ export const FUNCTION_LIST_MATH: IFunctionInfo[] = [ | |||
}, | |||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need handle functionParameter in function-list, you can test in UI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs improvement
close #xxx
Pull Request Checklist