aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-05-29 13:52:43 +0200
committerDmitry Jemerov <yole@jetbrains.com>2015-05-29 13:52:43 +0200
commit64414ce984bc86e09b8724adbd01f1cb2646c17e (patch)
tree802710da5009b0b86519cc7cde9cdb6685cc7c99 /test
parent2fc80c4aae0d2957b34b176b9a2a48cb5089f41c (diff)
downloaddokka-64414ce984bc86e09b8724adbd01f1cb2646c17e.tar.gz
dokka-64414ce984bc86e09b8724adbd01f1cb2646c17e.tar.bz2
dokka-64414ce984bc86e09b8724adbd01f1cb2646c17e.zip
apply code cleanup; fix couple of deprecations manually
Diffstat (limited to 'test')
-rw-r--r--test/src/TestAPI.kt2
-rw-r--r--test/src/markdown/MarkdownTestRunner.kt18
-rw-r--r--test/src/model/JavaTest.kt2
3 files changed, 11 insertions, 11 deletions
diff --git a/test/src/TestAPI.kt b/test/src/TestAPI.kt
index 171b5b9d..165278f9 100644
--- a/test/src/TestAPI.kt
+++ b/test/src/TestAPI.kt
@@ -58,7 +58,7 @@ public fun verifyOutput(roots: Array<ContentRoot>, outputExtension: String, outp
verifyModel(*roots) {
val output = StringBuilder()
outputGenerator(it, output)
- val ext = outputExtension.trimLeading(".")
+ val ext = outputExtension.removePrefix(".")
val path = roots.first().path
val expectedOutput = File(path.replaceAfterLast(".", ext, path + "." + ext)).readText()
assertEqualsIgnoringSeparators(expectedOutput, output.toString())
diff --git a/test/src/markdown/MarkdownTestRunner.kt b/test/src/markdown/MarkdownTestRunner.kt
index 4aceb8e8..867deece 100644
--- a/test/src/markdown/MarkdownTestRunner.kt
+++ b/test/src/markdown/MarkdownTestRunner.kt
@@ -18,7 +18,7 @@ data class MarkdownTestUniqueId(val id: Int) : Serializable {
public open class MarkdownSpecification(val path: String, val processor: (String) -> String)
-trait MarkdownTest {
+interface MarkdownTest {
fun description(): Description
}
@@ -64,7 +64,7 @@ public open class MarkdownTestSection(val spec: MarkdownSpecification, val title
when (child) {
is MarkdownTestCase -> child.run(notifier)
is MarkdownTestSection -> {
- if (child.children.size == 0) {
+ if (child.children.size() == 0) {
notifier.fireTestStarted(child.description())
notifier.fireTestFinished(child.description())
} else {
@@ -83,18 +83,18 @@ public class MarkdownTestRunner(specificationClass: Class<MarkdownSpecification>
private fun createTests(parent: MarkdownTestSection, lines: List<String>): Int {
val testMark = lines.takeWhile { it.trim() != "." }
- val testHtml = lines.drop(testMark.size).drop(1).takeWhile { it.trim() != "." }
+ val testHtml = lines.drop(testMark.size()).drop(1).takeWhile { it.trim() != "." }
val markdown = testMark.join("\n", postfix = "\n", prefix = "\n")
val html = testHtml.join("\n", postfix = "\n")
val markdownTestCase = MarkdownTestCase(spec, markdown, html)
parent.children.add(markdownTestCase)
- return testMark.size + testHtml.size + 3
+ return testMark.size() + testHtml.size() + 3
}
private fun createSections(parent: MarkdownTestSection, lines: List<String>, level: Int): Int {
var sectionNumber = 1
var index = 0
- while (index < lines.size) {
+ while (index < lines.size()) {
val line = lines[index]
if (line.trim() == ".") {
@@ -102,7 +102,7 @@ public class MarkdownTestRunner(specificationClass: Class<MarkdownSpecification>
continue
}
- val head = line.takeWhile { it == '#' }.length
+ val head = line.takeWhile { it == '#' }.length()
if (head == 0) {
index++
continue
@@ -117,9 +117,9 @@ public class MarkdownTestRunner(specificationClass: Class<MarkdownSpecification>
sectionNumber++
val section = MarkdownTestSection(spec, title)
val lastIndex = createSections(section, lines.subList(index + 1, lines.lastIndex), level + 1) + index + 1
- if (section.children.size > 0)
+ if (section.children.size() > 0)
parent.children.add(section)
- val nextHead = lines[lastIndex].takeWhile { it == '#' }.length
+ val nextHead = lines[lastIndex].takeWhile { it == '#' }.length()
if (nextHead < level) {
return lastIndex
}
@@ -128,6 +128,6 @@ public class MarkdownTestRunner(specificationClass: Class<MarkdownSpecification>
}
index++
}
- return lines.size
+ return lines.size()
}
} \ No newline at end of file
diff --git a/test/src/model/JavaTest.kt b/test/src/model/JavaTest.kt
index cef548c3..3129bcc0 100644
--- a/test/src/model/JavaTest.kt
+++ b/test/src/model/JavaTest.kt
@@ -12,7 +12,7 @@ public class JavaTest {
with(cls.members.single()) {
assertEquals("fn", name)
assertEquals(DocumentationNode.Kind.Function, kind)
- assertEquals("Summary for Function", content.summary.toTestString().trimTrailing())
+ assertEquals("Summary for Function", content.summary.toTestString().trimEnd())
assertEquals(3, content.sections.size())
with(content.sections[0]) {
assertEquals("Parameters", tag)