Skip to content

Commit

Permalink
fix: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Dec 29, 2023
1 parent 0513f79 commit 0c2d62e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ data class SimilarChunkIns(
} else {
similarChunks
}
"\n// Similar chunk:\n ```${language}\n${similarChunksLines.joinToString("\n")}\n```"
"\n// Similar chunk:\n```${language}\n${similarChunksLines.joinToString("\n")}\n```"
} else {
""
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,33 @@ public class HelloController {

result.size shouldBe 3

result.first().similarChunks shouldBe """
// Compare this snippet from cc.unitmesh.testng.repository.BlogRepository
//
// @Repository
// public interface BlogRepository extends CrudRepository<BlogPost, Long> {
//
// }
//
""".trimIndent()
result.first().unique().input shouldBe """
// Similar chunk:
```
// Compare this snippet from cc.unitmesh.testng.repository.BlogRepository
//
// @Repository
// public interface BlogRepository extends CrudRepository<BlogPost, Long> {
//
// }
//
```
Code:
```
package cc.unitmesh.testng.service;
import cc.unitmesh.testng.entity.BlogPost;
import cc.unitmesh.testng.repository.BlogRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class BlogService {
@Autowired
BlogRepository blogRepository;
public BlogPost createBlog(BlogPost blogDto) {
```"""
}
}

0 comments on commit 0c2d62e

Please sign in to comment.