-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correct casts for negative numbers and test file name for inner classes
- Loading branch information
1 parent
8ef6bd5
commit 870153f
Showing
11 changed files
with
209 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
utbot-framework/src/main/kotlin/org/utbot/framework/plugin/api/utils/ClassNameUtils.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package org.utbot.framework.plugin.api.utils | ||
|
||
import org.utbot.framework.plugin.api.ClassId | ||
import org.utbot.framework.plugin.api.util.nameWithEnclosingClassesAsContigousString | ||
|
||
object ClassNameUtils { | ||
fun generateTestClassName( | ||
testClassCustomName: String?, | ||
testClassPackageName: String, | ||
classUnderTest: ClassId, | ||
): Pair<String, String> { | ||
val packagePrefix = if (testClassPackageName.isNotEmpty()) "$testClassPackageName." else "" | ||
val simpleName = testClassCustomName ?: generateTestClassShortName(classUnderTest) | ||
val name = "$packagePrefix$simpleName" | ||
return Pair(name, simpleName) | ||
} | ||
|
||
fun generateTestClassShortName(classUnderTest: ClassId): String = | ||
"${classUnderTest.nameWithEnclosingClassesAsContigousString}Test" | ||
} | ||
|
||
|
15 changes: 0 additions & 15 deletions
15
utbot-framework/src/main/kotlin/org/utbot/framework/plugin/api/utils/CodeLanguageUtils.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.