aboutsummaryrefslogtreecommitdiff
path: root/ktlint-ruleset-standard/src/test/kotlin/com/github/shyiko/ktlint/ruleset/standard/package-test.kt
diff options
context:
space:
mode:
Diffstat (limited to 'ktlint-ruleset-standard/src/test/kotlin/com/github/shyiko/ktlint/ruleset/standard/package-test.kt')
-rw-r--r--ktlint-ruleset-standard/src/test/kotlin/com/github/shyiko/ktlint/ruleset/standard/package-test.kt7
1 files changed, 5 insertions, 2 deletions
diff --git a/ktlint-ruleset-standard/src/test/kotlin/com/github/shyiko/ktlint/ruleset/standard/package-test.kt b/ktlint-ruleset-standard/src/test/kotlin/com/github/shyiko/ktlint/ruleset/standard/package-test.kt
index 016cbd46..3c42d4b4 100644
--- a/ktlint-ruleset-standard/src/test/kotlin/com/github/shyiko/ktlint/ruleset/standard/package-test.kt
+++ b/ktlint-ruleset-standard/src/test/kotlin/com/github/shyiko/ktlint/ruleset/standard/package-test.kt
@@ -20,14 +20,17 @@ fun testLintUsingResource(rule: Rule, qualifier: String = "", userData: Map<Stri
}
val input = resourceText.substring(0, dividerIndex)
val errors = resourceText.substring(dividerIndex + 1).split('\n').mapNotNull { line ->
- if (line.isBlank() || line == "// expect") null else
+ if (line.isBlank() || line == "// expect") {
+ null
+ } else {
line.trimMargin("// ").split(':', limit = 3).let { expectation ->
if (expectation.size != 3) {
throw RuntimeException("$resource expectation must be a triple <line>:<column>:<message>")
- // " (<message> is not allowed to contain \":\")")
+ // " (<message> is not allowed to contain \":\")")
}
LintError(expectation[0].toInt(), expectation[1].toInt(), rule.id, expectation[2])
}
+ }
}
assertThat(rule.lint(input, userData)).isEqualTo(errors)
}