Skip to content

Test class public name for nested classes in Contest Estimator does not match with test filename #1622

@Damtev

Description

@Damtev

Description

The name of the test class generated in Contest Estimator for nested class does not match with the corresponding filename which leads to a compilation error (see an attached error).

To Reproduce

Steps to reproduce the behavior:

  1. Run ContestEstimator for any nested class (for example, org.antlr.v4.codegen.target.JavaScriptTarget$JavaStringRenderer)

Expected behavior

Correct tests are generated, test class would be compiled.

Actual behavior

The generated test file could not be compiled because of a wrong class name.

Visual proofs (screenshots, logs, images)

Compilation errors: C:\work\UTBotJava\utbot-junit-contest\build\output\test_candidates\antlr\org\antlr\v4\codegen\target\JavaScriptTarget_JavaStringRendererTest.java:11: error: class JavaStringRendererTest is public, should be declared in a file named JavaStringRendererTest.java
public final class JavaStringRendererTest {
             ^
1 error

Environment

Contest Estimator, 60s+ second for generation preferred.

Additional context

No additional context.

Metadata

Metadata

Assignees

Labels

comp-codegenIssue is related to code generatorcomp-contest-estimatorIssue is related to contest estimatorctg-bugIssue is a bug

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions