Skip to content

Refactor PMComplexTest >> testComplexConjugate #246

@olekscode

Description

@olekscode

This is the current implementation

testComplexConjugate
	| z complexConjugateOfZ expected |
	z := 5 - 6 i.
	
	complexConjugateOfZ := z complexConjugate .
	
	expected := 5 + 6 i.
	self assert: complexConjugateOfZ equals: expected.

It has many unnecessary temporary variables that make it hard to read
I propose to replace it with the following:

testComplexConjugate

	self assert: (5 - 6i) complexConjugate equals: (5 + 6i).

Same thing but more clear

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions