Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

onewhl
Copy link
Member

@onewhl onewhl commented Jul 12, 2022

Description

PR fixes the way UTBot capitalizes method names.
Now it capitalizes all parts of the method name properly.

Fixes #485

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Automated Testing

See tests in SummaryReturnExampleTest.kt, for example, SummaryReturnExampleTest.testCompareChar().
UTBot generated these names before the fix:

        "testCompareChars_NLessThan1"
        "testCompareChars_0OfCharactertoCharsiEqualsA" // need to change i -> I, to -> To
        "testCompareChars_0OfCharactertoCharsiEqualsB" // need to change i -> I, to -> To
        "testCompareChars_0OfCharactertoCharsiNotEqualsB" // need to change i -> I, to ->To

And these names after the fix:

       "testCompareChars_NLessThan1"
       "testCompareChars_0OfCharacterToCharsIEqualsA"
       "testCompareChars_0OfCharacterToCharsIEqualsB"
       "testCompareChars_0OfCharacterToCharsINotEqualsB"

Checklist (remove irrelevant options):

  • The change followed the style guidelines of the UTBot project
  • Self-review of the code is passed
  • The change contains enough commentaries, particularly in hard-to-understand areas
  • New documentation is provided or existed one is altered
  • No new warnings
  • Tests that prove my change is effective
  • All tests pass locally with my changes

@onewhl onewhl added the comp-summaries Something related to the method names, code comments and display names generation label Jul 12, 2022
@onewhl onewhl requested a review from amandelpie July 12, 2022 13:17
@onewhl
Copy link
Member Author

onewhl commented Jul 12, 2022

I don't know why tests in InnerMockWithFieldExampleTest and MockWithFieldExampleTest fail.
I noticed that it happens in other PRs opened today, so it seems that some other commit in the main branch broke the test.

Copy link
Collaborator

@amandelpie amandelpie left a comment

Choose a reason for hiding this comment

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

Please do something with the isLegitSymbolForFunctionName function

@onewhl onewhl force-pushed the onewhl/485-method-name-capitalization branch from 8f32d68 to afdfc4f Compare July 18, 2022 09:18
Copy link
Collaborator

@amandelpie amandelpie left a comment

Choose a reason for hiding this comment

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

LGTM

@onewhl onewhl merged commit 3d91def into main Jul 18, 2022
@onewhl onewhl deleted the onewhl/485-method-name-capitalization branch July 18, 2022 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-summaries Something related to the method names, code comments and display names generation
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

UTBot generates test method names containing a typo
2 participants