Skip to content

Add explicit test cases for unary operators after binary operators in mathParser #9273

@coderabbitai

Description

@coderabbitai

Description

Add explicit parameterized test cases for unary operators appearing after binary operators in src/lib/litegraph/src/utils/mathParser.test.ts.

This pattern (2*-3, 1+-2, 2--3, -2*-3) is the #1 source of bugs in hand-rolled math parsers and is most likely to regress. While the current parser implementation handles these correctly, only 2*-3 is covered implicitly in the complex expression block.

Test Cases to Add

['1+-2', -1],
['2--3', 5],
['-2*-3', 6],
['-(2+3)*-(4+5)', 45],

References

┆Issue is synchronized with this Notion page by Unito

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions