Skip to content

Conversation

@dg
Copy link
Member

@dg dg commented Feb 18, 2014

No description provided.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you sure about this one? I think there should be &&

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why && ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know, I just woke up and it looks weird :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't there be the path problem that milo tried to solve?

@fprochazka
Copy link
Contributor

@milo any objections?

@milo
Copy link
Member

milo commented Feb 18, 2014

Nice and elegant! I had to sit and draw it on paper :) Comments in code.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe shorter:

            if (isset($checked[$expected])) {
                return $checked[$expected] === $actual;
            } elseif (isset($checked[$actual])) {
                return FALSE;
            } elseif ($expected === $actual) {
                return TRUE;
            }

Btw. second elseif seems logically, but test passes without it too. It just returns FALSE on next level.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, in this case the second if is unnecessary, because $expected !== $actual. Repushed.

Now it is really very simple implementation ;-)

@milo
Copy link
Member

milo commented Feb 19, 2014

Great. I would merge it soon if no one complains.

@fprochazka
Copy link
Contributor

👍

dg added a commit that referenced this pull request Feb 19, 2014
Assert::isEqual: can compare recursive objects [Closes #93]
@dg dg merged commit d789015 into nette:master Feb 19, 2014
@fprochazka
Copy link
Contributor

👏

@dg dg deleted the pull-recursive branch March 23, 2014 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants