Test

@Target(allowedTargets = [AnnotationTarget.FUNCTION])
expect annotation class Test(source)

Marks a function as a test.

Only class member functions should be annotated with Test, the annotated function should not accept any parameters and its return type has to be Unit.

Applying Test to top-level, extension, or object member functions, functions accepting any parameters or functions with a return type other than Unit may lead to compilation or runtime errors, and behavior may vary on different targets.

import kotlin.test.*

public class ArithmeticsTest {
@Test
fun addition() {
assertEquals(4, 2 + 2)
}
}

Since Kotlin

1.0
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
actual annotation class Test(source)

Marks a function as a test.

Only class member functions could be annotated with Test, the annotated function should not accept any parameters and its return type has to be Unit.

Applying Test to top-level, extension, or object member functions, functions accepting any parameters or functions with a return type other than Unit may lead to compilation or runtime errors, and behavior may vary on different targets.

import kotlin.test.*

public class ArithmeticsTest {
@Test
fun addition() {
assertEquals(4, 2 + 2)
}
}

Since Kotlin

1.1
actual typealias Test = org.junit.Test(source)

Since Kotlin

1.0
actual typealias Test = org.junit.jupiter.api.Test

Since Kotlin

1.0
actual typealias Test = org.testng.annotations.Test

Since Kotlin

1.0
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
actual annotation class Test(source)

Marks a function as a test.

Only class member functions could be annotated with Test, the annotated function should not accept any parameters and its return type has to be Unit.

Applying Test to top-level, extension, or object member functions, functions accepting any parameters or functions with a return type other than Unit may lead to compilation or runtime errors, and behavior may vary on different targets.

import kotlin.test.*

public class ArithmeticsTest {
@Test
fun addition() {
assertEquals(4, 2 + 2)
}
}

Since Kotlin

1.3
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
actual annotation class Test(source)

Marks a function as a test.

Only class member functions could be annotated with Test, the annotated function should not accept any parameters and its return type has to be Unit.

Applying Test to top-level, extension, or object member functions, functions accepting any parameters or functions with a return type other than Unit may lead to compilation or runtime errors, and behavior may vary on different targets.

import kotlin.test.*

public class ArithmeticsTest {
@Test
fun addition() {
assertEquals(4, 2 + 2)
}
}

Since Kotlin

1.8
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
actual annotation class Test(source)

Marks a function as a test.

Only class member functions could be annotated with Test, the annotated function should not accept any parameters and its return type has to be Unit.

Applying Test to top-level, extension, or object member functions, functions accepting any parameters or functions with a return type other than Unit may lead to compilation or runtime errors, and behavior may vary on different targets.

import kotlin.test.*

public class ArithmeticsTest {
@Test
fun addition() {
assertEquals(4, 2 + 2)
}
}

Since Kotlin

1.8