Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @RunWith(JUnitPlatform::class)
- class ExpressionFunctionTest : Spek({
- describe("one line function rule") {
- it("have to specify the return type") {
- val rule = ExpressionFunctionRule()
- assertThat(rule.lint(
- """
- fun add(a: Int, b: Int): Int = a + b
- """
- .trimIndent())
- ).isEqualTo(emptyList<LintError>())
- assertThat(rule.lint(
- """
- fun add(a: Int, b: Int) = a + b
- """
- .trimIndent())
- ).isEqualTo(listOf(LintError(1, 1, "one-line-function", "need return type!!!")))
- }
- }
- })
Add Comment
Please, Sign In to add comment