From 0c8ca828ebfc974dae9a7235d07048f9fc240241 Mon Sep 17 00:00:00 2001 From: Pavel Punegov <32519625+PavelPunegov@users.noreply.github.com> Date: Tue, 6 Mar 2018 09:10:15 +0300 Subject: [PATCH] Add AfterTest and BeforeTest aliases for tests --- backend.native/tests/testing/annotations.kt | 8 ++++---- runtime/src/main/kotlin/kotlin/test/Annotation.kt | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/backend.native/tests/testing/annotations.kt b/backend.native/tests/testing/annotations.kt index 34f48f95201..deec15b52d7 100644 --- a/backend.native/tests/testing/annotations.kt +++ b/backend.native/tests/testing/annotations.kt @@ -20,16 +20,16 @@ object IgnoredObject { class A { companion object { - @BeforeEach fun before() { println("before (A.companion)") } - @AfterEach fun after() { println("after (A.companion)") } + @BeforeTest fun before() { println("before (A.companion)") } + @AfterTest fun after() { println("after (A.companion)") } @Test fun test1() { println("test1 (A.companion)") } @BeforeClass fun beforeClass() { println("beforeClass (A.companion)") } @AfterClass fun afterClass() { println("afterClass (A.companion)") } } - @BeforeEach fun before() { println("before (A)") } - @AfterEach fun after() { println("after (A)") } + @BeforeTest fun before() { println("before (A)") } + @AfterTest fun after() { println("after (A)") } @Test fun test1() { println("test1 (A)") } @Ignore @Test fun ignoredTest() { throw AssertionError("Ignored test") } diff --git a/runtime/src/main/kotlin/kotlin/test/Annotation.kt b/runtime/src/main/kotlin/kotlin/test/Annotation.kt index 31e97005f30..7a2933acafd 100644 --- a/runtime/src/main/kotlin/kotlin/test/Annotation.kt +++ b/runtime/src/main/kotlin/kotlin/test/Annotation.kt @@ -58,3 +58,6 @@ annotation class AfterEach @Retention(AnnotationRetention.SOURCE) @Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) annotation class Ignore + +typealias AfterTest = AfterEach +typealias BeforeTest = BeforeEach