Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add a flag to disable imports addition from formatter side#1410

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
EgorkaKulikov merged 1 commit intomainfromandrey-t/repeating-imports
Nov 22, 2022

Conversation

@sofurihafe
Copy link
Member

Description

Choosing a different package as a test source root may lead to unnecessary repeating imports being rendered. The cause was that formatter was able to add extra imports when there was a method (which is from a different package) invocation. This PR fixes prohibits such behavior.

Fixes # (1286)

Type of Change

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

How Has This Been Tested?

Automated Testing

utbot-samples.

Manual Scenario

OpenUTBotJava project, generate tests for theorg.utbot.examples.exceptions.ExceptionExamples class choosing different package as atest source root location. Verify that the generated code has no repeating imports as it was described in the issue:

packageorg.utbot.examples.exceptions;importorg.junit.jupiter.api.Test;importorg.junit.jupiter.api.DisplayName;importstaticorg.junit.jupiter.api.Assertions.assertEquals;importstaticorg.junit.jupiter.api.Assertions.assertThrows;importstaticorg.utbot.runtime.utils.java.UtUtils.createInstance;publicfinalclassExceptionExamplesTest {    <...>}

@EgorkaKulikovEgorkaKulikovenabled auto-merge (squash)November 22, 2022 13:03
@EgorkaKulikovEgorkaKulikov merged commit95d6cb0 intomainNov 22, 2022
@EgorkaKulikovEgorkaKulikov deleted the andrey-t/repeating-imports branchNovember 22, 2022 13:15
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@EgorkaKulikovEgorkaKulikovEgorkaKulikov approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Many identicalimports when generating tests into other module

3 participants

@sofurihafe@EgorkaKulikov

[8]ページ先頭

©2009-2025 Movatter.jp