diff options
Diffstat (limited to 'plugins/base/base-test-utils')
-rw-r--r-- | plugins/base/base-test-utils/api/base-test-utils.api | 1 | ||||
-rw-r--r-- | plugins/base/base-test-utils/src/main/kotlin/renderers/SignatureUtils.kt | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/plugins/base/base-test-utils/api/base-test-utils.api b/plugins/base/base-test-utils/api/base-test-utils.api index a0b535f2..6a31e468 100644 --- a/plugins/base/base-test-utils/api/base-test-utils.api +++ b/plugins/base/base-test-utils/api/base-test-utils.api @@ -95,6 +95,7 @@ public final class signatures/Parameters : utils/Tag { public final class signatures/SignatureUtilsKt { public static final fun firstSignature (Lorg/jsoup/nodes/Element;)Lorg/jsoup/nodes/Element; + public static final fun lastSignature (Lorg/jsoup/nodes/Element;)Lorg/jsoup/nodes/Element; public static final fun renderedContent (Lutils/TestOutputWriter;Ljava/lang/String;)Lorg/jsoup/nodes/Element; public static synthetic fun renderedContent$default (Lutils/TestOutputWriter;Ljava/lang/String;ILjava/lang/Object;)Lorg/jsoup/nodes/Element; public static final fun signature (Lorg/jsoup/nodes/Element;)Lorg/jsoup/select/Elements; diff --git a/plugins/base/base-test-utils/src/main/kotlin/renderers/SignatureUtils.kt b/plugins/base/base-test-utils/src/main/kotlin/renderers/SignatureUtils.kt index 1d725398..3397b2b4 100644 --- a/plugins/base/base-test-utils/src/main/kotlin/renderers/SignatureUtils.kt +++ b/plugins/base/base-test-utils/src/main/kotlin/renderers/SignatureUtils.kt @@ -11,7 +11,8 @@ fun TestOutputWriter.renderedContent(path: String = "root/example.html"): Elemen .single() fun Element.signature(): Elements = select("div.symbol.monospace") -fun Element.firstSignature(): Element = signature().first() +fun Element.firstSignature(): Element = signature().first() ?: throw NoSuchElementException("No signature found") +fun Element.lastSignature(): Element = signature().last() ?: throw NoSuchElementException("No signature found") class Parameters(vararg matchers: Any) : Tag("span", *matchers, expectedClasses = listOf("parameters")) class Parameter(vararg matchers: Any) : Tag("span", *matchers, expectedClasses = listOf("parameter"))
\ No newline at end of file |