Skip to content
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

Move HashArray::equals to SnakList::equals #713

Merged
merged 1 commit into from
Mar 15, 2017
Merged

Conversation

thiemowmde
Copy link
Contributor

@thiemowmde thiemowmde commented Jan 14, 2017

This goes along with #714 (and will run into a merge conflict – feel free to merge whichever first, I will do the rebase). Both are split from #702 to make that big patch it easier to review later.

Note that I rewrote the tests entirely. This is also the main reason for this patch, to make sure SnakList is properly covered with tests before we are applying the big change in #702.

@brightbyte
Copy link

please rebase. +2 would merge

@thiemowmde
Copy link
Contributor Author

Manually rebased, and made sure the changes are identical to before.

'different objects with different content are not equal' => [
$oneSnak,
new SnakList( [ new PropertyNoValueSnak( 2 ) ] ),
false
Copy link
Member

Choose a reason for hiding this comment

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

I'd rather see this as a separate test (as in separate method) instead of squashing both test case data, and the expected result in the data provider method but whatever.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Both are valid approaches, and even if I agree that splitting test cases is the better approach in many cases, I disagree in this case. Readability is key here, and the names of these test cases almost read like a poem. This poem will be destroyed if the last one is not an array key any more but a method name. I don't think this is worth it in this case, if the only benefit is that five booleans can be removed.

Copy link
Member

Choose a reason for hiding this comment

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

On the off-topic side: if you really want to compare source code to literature works you might consider using "prose" in comparison. I wouldn't consider "readability" or "clarity" an obvious value of "good" poem :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can totally read this out aloud as a poem. Hm. Let me add this as a proposal to the Lightning Talk board.

@manicki manicki merged commit f800f09 into master Mar 15, 2017
@manicki manicki deleted the equalHashArrays branch March 15, 2017 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants