Skip to content

Commit

Permalink
Fix some test parsing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
pderakhshanfar committed Aug 29, 2023
1 parent 836a32d commit b9c82a1
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ class TestsAssembler(
fun returnTestSuite(packageName: String): TestSuiteGeneratedByLLM? {
try {
val testSuite = TestSuiteGeneratedByLLM(project)
rawText = rawText.split("```")[1]
if(rawText.contains("```"))
rawText = rawText.split("```")[1]

testSuite.packageString = packageName

Expand Down Expand Up @@ -170,7 +171,9 @@ class TestsAssembler(

// Get test's body
// remove opening bracket
var testBody: String = rawTest.split("{")[1].trim()
var testBody =rawTest.split("{").toMutableList().apply {
removeFirst()
}.joinToString("{").trim()

// remove closing bracket

Expand Down

0 comments on commit b9c82a1

Please sign in to comment.