Skip to content

What is the meaning of separateExpression and isSeparable? #399

@SergeStinckwich

Description

@SergeStinckwich

The semantic of the separateExpression method on KEBinaryExpression is not really clear.
Tests should give the semantic more clearly and the method should be renamed appropriately.

testSeparateABinaryExpression

	| s1 s2 s3 s4 |
	s1 := 's=-(A+B+C)*E*D' parseAsAnEquation.
	s2 := 's=-(A+B)*(-C)' parseAsAnEquation.
	s3 := 's=(-E)*D*F*(A+B)' parseAsAnEquation.
	s4 := 's=(A+B)*(C+D)' parseAsAnEquation.
	self assert: 3 equals: s1 expression separateExpression size.
	self assert: 2 equals: s2 expression separateExpression size.
	self assert: 2 equals: s3 expression separateExpression size.
	self assert: 4 equals: s4 expression separateExpression size

The same for the method isSeparable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions