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

Ruby and Swift merge sort implementation #461

Merged
merged 2 commits into from
Aug 27, 2015

Conversation

TarangKhanna
Copy link
Contributor

No description provided.

@dalleng
Copy link
Collaborator

dalleng commented Jun 24, 2015

Could you please add some unit tests as well?

@kennyledet
Copy link
Owner

Hey, thanks for the Swift implementation bro! Could you add some tests in the structure outlined here #459 (comment) ?

I'll get it merged as soon as that's done.

@TarangKhanna
Copy link
Contributor Author

I'll try to add unit tests, but since I don't see why it would be required when you can see that the array is really sorted(tests are kinda inbuilt here). I did so because of the other sorting implementations in other languages I saw here. If you really want I'll make the tests, which really are done in the main program, just need to convert that to an assert.

@patrickyevsukov
Copy link
Collaborator

Thanks for the contribution! And in swift no less; great stuff 😄

I don't see why it would be required when you can see that the array is really sorted

The benefit of automated unit testing is that it transfers the burden of checking output [from the user to the system.] A million users could clone this repo, modify your algorithm, run your provided unit tests, and assertEquals(output, expectedOutput) will provide a faithful assessment of whether or not the algorithm is functioning properly; the odds of a user missing a few elements that are out of place are incredibly high, compared to the odds of assertEquals() malfunctioning. This is especially true as the size of the input grows to a level where it would be infeasible to check the algorithm's output manually.

I did so because of the other sorting implementations in other languages I saw here

Yes, as was discussed in #459, there are many past contributions which could include better tests, or any tests at all. That should not prevent the inclusion of proper tests going forward. There is probably a better way to address testing in general, and I have some thoughts on that - but that's a whole separate thread for a later time...

just need to convert that to an assert

Yes, that would be great; in a separate test file. Thanks!

do check the test case for ruby which i am not sure about
@patrickyevsukov
Copy link
Collaborator

Thanks for adding tests!

patrickyevsukov added a commit that referenced this pull request Aug 27, 2015
Ruby and Swift merge sort implementation
@patrickyevsukov patrickyevsukov merged commit eb0f3f6 into kennyledet:master Aug 27, 2015
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.

4 participants