Skip to content

UTBot generates Java tests inside .kt file for Kotlin code #1918

Closed
@tyuldashev

Description

@tyuldashev

Description

When user starts test generation for Kotlin code UTBot creates .kt file and put there Java code which obviously cannot be compiled.

To Reproduce

Steps to reproduce the behavior:

  1. Open UTBot Java project
  2. In UTBot settings set "Generated test language" = "Kotlin"
  3. Invoke test generation for org/utbot/examples/codegen/FileWithTopLevelFunctions.kt

Expected behavior

Functional Kotlin tests are generated.

Actual behavior

FileWithTopLevelFunctionsKtTest.kt created with Java code which cannot be executed.

Visual proofs (screenshots, logs, images)
image

Metadata

Metadata

Assignees

Labels

comp-codegenIssue is related to code generatorctg-bugIssue is a buglang-kotlinIssue is related to Kotlin language supportpriority-top-focusTop priority chosen by dev teamstatus-verifiedBug fix is verified

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions