GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Added CombSortTest.java by jayyusi · Pull Request #825 · TheAlgorithms/Java

Conversation

@jayyusi

@jayyusi jayyusi commented Sep 14, 2019

Copy link
Copy Markdown

copied over CombSort.java from master branch to Development branch.
Added CombSortTest.java to Development branch

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jayyusi
Added CombSortTest.java
15a8c6b
copied over CombSort.java from master branch to Development branch.
Added CombSortTest.java to Development branch
@jayyusi jayyusi mentioned this pull request Sep 14, 2019
Convert the repository into a Java project #474
Closed
mainrs
mainrs suggested changes Sep 15, 2019
View reviewed changes

@mainrs mainrs left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This should fix some naming and formatting errors to match with Java's coding style.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/test/java/com/sorts/CombSortTest.java Outdated

class CombSortTest {

//One global combSort instance variable

@mainrs mainrs Sep 15, 2019

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

The comment can be removed, not really needed.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@jayyusi jayyusi Sep 15, 2019

Copy link
Copy Markdown
Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

done.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/test/java/com/sorts/CombSortTest.java Outdated
//One global combSort instance variable
CombSort combSort = new CombSort();

//Integer Sort Test

@mainrs mainrs Sep 15, 2019

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Same goes here. The naming scheme of your methods should be testSomething. Like testIntegerSort and testStringSort. Methods in Java start with a lowercase letter. Make sure to correct that everywhere else too.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@jayyusi jayyusi Sep 15, 2019

Copy link
Copy Markdown
Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

how about combSortIntegerTest ?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@mainrs mainrs Sep 15, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

No, just change it to testStringSort and testIntegerSort. Your class is named CombSortTest already, no need to add it to the method names. Alongside that, all test methods from the other classes are named using the testXXX scheme. And to keep consistency it would be better if you could change them too :)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@jayyusi jayyusi Sep 15, 2019

Copy link
Copy Markdown
Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

CycleSortTest class does not follow the consistency you mentioned ?!
it follows what I suggested :)
class CycleSortTest {

@Test
void cycleSortIntegerTest() {

    CycleSort cycleSort = new CycleSort();

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@mainrs mainrs Sep 15, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

If you take a look at all the other tests, they follow the convention testXXX where XXX gives some details of what is being tested. In your case, it would be testStringSort or something similar.

Edit:
Well, looks like some tests need a rename then :) They shouldn't be named like that though. Even the JUnit site lists the testXXX naming scheme as a go-to. And in all Java based open source projects I worked on they mostly used that scheme.

Well, I am in no position to force you to use it, I'm no member of this organisation. At least make the method names lowercase please. Because THAT is Java convention.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@jayyusi jayyusi Sep 15, 2019

Copy link
Copy Markdown
Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

haha, yes now you see what I mean, and now I see what you mean, I just noticed in the /search folder, the tests follow the naming convention of testXXX.

I did the changes, did you want me to also remove all the comments like this one:
//Integer Sort Test

I'm almost done, and thank you for the review and the edit suggestions. Its always good to have another pair of eyes. I admit I totally overlooked the method names.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@mainrs mainrs Sep 15, 2019

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Would be nice if you could remove any comments that don't really add value, yes. If they are needed to explain why a certain thing is done, let them in. But something like // Integer Sort test is not really needed.

No problem :)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@jayyusi jayyusi Sep 15, 2019

Copy link
Copy Markdown
Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

alright, done.
I made a commit to the same pull request.
Do you know when will pull requests be merged with the development branch ?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@mainrs mainrs Sep 15, 2019

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

It usually takes some time...

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/test/java/com/sorts/CombSortTest.java Outdated

//compare the two results, our CombSort vs. Java's sort
Assertions.assertArrayEquals(array1,array2);

@mainrs mainrs Sep 15, 2019

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Remove empty lines at the end of each method.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@jayyusi jayyusi Sep 15, 2019

Copy link
Copy Markdown
Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

done.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/test/java/com/sorts/CombSortTest.java Outdated

//Integer Sort Test
@Test
void CombSortIntegerTest(){

@mainrs mainrs Sep 15, 2019

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Method name, see above.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/test/java/com/sorts/CombSortTest.java Outdated

//String Sort Test
@Test
void CombSortStringTest(){

@mainrs mainrs Sep 15, 2019

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Method name, see above.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jayyusi
Update CombSortTest.java
ae92899
removed unnecessary comments
removed blank lines at end of method
modified method names
@ayaankhan98

ayaankhan98 commented Feb 26, 2021

Copy link
Copy Markdown
Member

Hey please make PR to master branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ayaankhan98 ayaankhan98 closed this Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@mainrs mainrs mainrs requested changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@jayyusi @ayaankhan98 @mainrs
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.