Package-level declarations

Types

Link copied to clipboard
interface BaseTest : HasTestEnvironmentFactory<DefaultTestEnvironment.Factory> , TrimmedAsserts
Link copied to clipboard
class DefaultGradleKotlinAnvilAgpTestVersions(val a1: GradleDependencyVersion, val a2: KotlinDependencyVersion, val a3: AnvilDependencyVersion, val a4: AgpDependencyVersion) : GradleKotlinAnvilAgpTestVersions, HasGradleDependencyVersion, HasKotlinDependencyVersion, HasAnvilDependencyVersion, HasAgpDependencyVersion, Kase4<GradleDependencyVersion, KotlinDependencyVersion, AnvilDependencyVersion, AgpDependencyVersion>

Holds GradleDependencyVersion, KotlinDependencyVersion, AnvilDependencyVersion, and AgpDependencyVersion versions

Link copied to clipboard
interface GradleKotlinAnvilAgpTestVersions : TestVersions, HasGradleDependencyVersion, HasKotlinDependencyVersion, HasAnvilDependencyVersion, HasAgpDependencyVersion, Kase4<GradleDependencyVersion, KotlinDependencyVersion, AnvilDependencyVersion, AgpDependencyVersion> , GradleTestVersions, GradleKotlinTestVersions

Holds GradleDependencyVersion, KotlinDependencyVersion, and AgpDependencyVersion versions

Link copied to clipboard
interface HasTestVersions

Trait interface for McTestVersions

Link copied to clipboard
class McTestVersions(a1: GradleDependencyVersion, a2: KotlinDependencyVersion, a3: AnvilDependencyVersion, a4: AgpDependencyVersion) : GradleKotlinAnvilAgpTestVersions

The versions of dependencies which are changed during parameterized tests.

Link copied to clipboard
class McVersionMatrix(gradleVersions: List<String> = Versions.gradleList, agpVersions: List<String> = Versions.agpList, anvilVersions: List<String> = Versions.anvilList, kotlinVersions: List<String> = Versions.kotlinList) : KaseMatrix
Link copied to clipboard

Indicates that the annotated function/property should be ignored when walking a stack trace, such as in assertions or when trying to parse a test function's name.

Link copied to clipboard
open class TestEnvironment(names: List<String>, testLocation: TestLocation = TestLocation.get()) : TestEnvironment, TrimmedAsserts
Link copied to clipboard
Link copied to clipboard
internal object Versions
Link copied to clipboard
interface VersionsFactoryTest<ENV : TestEnvironment, HasTestVersions, FACT : TestEnvironmentFactory<McTestVersions, ENV>> : KaseTestFactory<McTestVersions, ENV, FACT> , HasKaseMatrix

Convenience interface for a test which uses KaseTestFactory in order to create DynamicTests for a JUnit5 test factory.

Properties

Link copied to clipboard

Functions

Link copied to clipboard

Replace Windows file separators with Unix ones, just for string comparison in tests

Link copied to clipboard
inline fun <T, R> T.asClueCatching(block: T.() -> R): R

Catch anything and rethrow, but prepend the receiver's toString(). This toString is evaluated lazily, meaning that it should reflect its state at the time of the exception (possibly excluding weirdness caused by concurrency).

Link copied to clipboard
fun String.clean(workingDir: File): String

Removes various bits of noise and machine-specific variables from a console or report output. Cleans the provided string by applying various modifications such as normalising line separators, using relative paths, enforcing Unix file separators, and removing specific strings or patterns.

Link copied to clipboard

Retrieves the class from a StackTraceElement.

Retrieves the class from a StackFrame.

Link copied to clipboard
fun Class<*>.enclosingCanonicalNames(includeSelf: Boolean = false): Sequence<String>

Provides a sequence of the canonical names of all enclosing classes of this Class.

Link copied to clipboard
fun Class<*>.enclosingClasses(includeSelf: Boolean = false): Sequence<Class<*>>

Provides a sequence of all the enclosing classes of this Class.

Link copied to clipboard
tailrec fun Class<*>.firstNonSyntheticClass(): Class<*>

Returns the current class if it's a real class, otherwise walks up the hierarchy of enclosing/nesting classes until it finds a real one.

Link copied to clipboard
fun <A> forAllBlocking(genA: Gen<A>, property: suspend PropertyContext.(A) -> Unit)

shorthand for the Kotest forAll, but blocking and always returning Unit

Link copied to clipboard
@JvmName(name = "forAllBlockingExtension")
fun <A> Gen<A>.forAllBlocking(property: suspend PropertyContext.(A) -> Unit)

shorthand for the Kotest forAll, but blocking and always returning Unit

Link copied to clipboard
inline fun <T : Any, R : Any> T.getPrivateFieldByName(name: String): R

Retrieves the value of a private property in the receiver instance by its name.

Link copied to clipboard
Link copied to clipboard
internal fun isSkipped(clazz: Class<*>, methodName: String): Boolean

Determines whether a method within the given class should be skipped.

Link copied to clipboard

Checks if the StackTraceElement should be skipped based on the SkipInStackTrace annotation.

Checks if the StackFrame should be skipped based on the SkipInStackTrace annotation.

Link copied to clipboard

Validates that all methods in the list are either annotated with SkipInStackTrace or not. If only some methods are annotated, an exception will be thrown.

Link copied to clipboard

Provides a sequence of the primary constructors of all non-abstract, non-sealed subclasses of the sealed class or interface that implement this KClass.

Link copied to clipboard

Returns the full tree of classes which implement a base sealed class/interface, including grandchildren, great-grandchildren, etc. This is different from KClass.sealedSubclasses in that the latter only returns the direct children.

Link copied to clipboard
inline fun <T : Any> KClass<T>.sealedSubclassInstances(vararg args: Any?): Sequence<T>

Provides a sequence of instances of all non-abstract, non-sealed subclasses of the sealed class or interface that implement this KClass. The instances are created using the primary constructor of each subclass, with the provided arguments.

Link copied to clipboard
Link copied to clipboard

replace absolute paths with relative ones

Link copied to clipboard
inline fun <R> withClueCatching(clue: () -> Any?, thunk: () -> R): R

Catch anything and rethrow, but prepend the clue's toString(). This is basically the same as just using Kotest's clue.asClue { ... }, except that asClue only catches assertion errors from inside Kotest.

Link copied to clipboard
fun File.writeGroovy(content: String)
Link copied to clipboard
fun File.writeJava(content: String)
Link copied to clipboard
fun File.writeKotlin(content: String)