From a100ffd66b83cd27bf7a86da5c45a3066d1a908d Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Thu, 25 Feb 2016 21:16:45 +0300 Subject: [PATCH] Minor: improve wording in the deprecation message. --- .../kotlin/test/CollectionAssertions.kt | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/libraries/kotlin.test/shared/src/main/kotlin/kotlin/test/CollectionAssertions.kt b/libraries/kotlin.test/shared/src/main/kotlin/kotlin/test/CollectionAssertions.kt index 28fda34bd5b..a04e3d0b64c 100644 --- a/libraries/kotlin.test/shared/src/main/kotlin/kotlin/test/CollectionAssertions.kt +++ b/libraries/kotlin.test/shared/src/main/kotlin/kotlin/test/CollectionAssertions.kt @@ -4,42 +4,42 @@ package kotlin.test import java.util.* -@Deprecated("This is an experimental part of API. It may be changed or removed in next releases.") +@Deprecated("This is an experimental part of the API. It may be changed or removed in newer releases.") class CollectionAssertionSession>(val collection: C) -@Deprecated("This is an experimental part of API. It may be changed or removed in next releases.") +@Deprecated("This is an experimental part of the API. It may be changed or removed in newer releases.") inline fun > assert(collection: C, block: CollectionAssertionSession.() -> Unit) { CollectionAssertionSession(collection).block() } -@Deprecated("This is an experimental part of API. It may be changed or removed in next releases.") +@Deprecated("This is an experimental part of the API. It may be changed or removed in newer releases.") fun > CollectionAssertionSession<*, C>.sizeShouldBe(expectedSize: Int, message: String? = null) { assertEquals(expectedSize, collection.size, message ?: "collection should have size $expectedSize but it is ${collection.size}") } -@Deprecated("This is an experimental part of API. It may be changed or removed in next releases.") +@Deprecated("This is an experimental part of the API. It may be changed or removed in newer releases.") fun CollectionAssertionSession.elementAtShouldBe(position: Int, expected: T, message: String? = null) { assertEquals(expected, collection.elementAt(position), message ?: "element at $position should be $expected") } -@Deprecated("This is an experimental part of API. It may be changed or removed in next releases.") +@Deprecated("This is an experimental part of the API. It may be changed or removed in newer releases.") fun > CollectionAssertionSession.elementAtShouldComply(position: Int, message: String? = null, predicate: (T) -> Boolean) { assertTrue(message) { predicate(collection.elementAt(position)) } } -@Deprecated("This is an experimental part of API. It may be changed or removed in next releases.") +@Deprecated("This is an experimental part of the API. It may be changed or removed in newer releases.") fun CollectionAssertionSession.lastElementShouldBe(expected: T, message: String? = null) { assertEquals(expected, collection.last(), message ?: "the last element should be $expected") } -@Deprecated("This is an experimental part of API. It may be changed or removed in next releases.") +@Deprecated("This is an experimental part of the API. It may be changed or removed in newer releases.") fun CollectionAssertionSession.containsAll(vararg elements: T) { for (e in elements) { assertTrue(message = "Element $e is missing in the collection") { e in collection } } } -@Deprecated("This is an experimental part of API. It may be changed or removed in next releases.") +@Deprecated("This is an experimental part of the API. It may be changed or removed in newer releases.") fun > CollectionAssertionSession.shouldBe(expectedElements: Iterable, message: String? = null) { val actual = collection.iterator() val expected = expectedElements.iterator() @@ -56,7 +56,7 @@ fun > CollectionAssertionSession.shouldBe(expectedElemen } } -@Deprecated("This is an experimental part of API. It may be changed or removed in next releases.") +@Deprecated("This is an experimental part of the API. It may be changed or removed in newer releases.") fun > CollectionAssertionSession.shouldBeSet(other: Set, message: String? = null) { for (e in other) { if (e !in collection) { @@ -70,7 +70,7 @@ fun > CollectionAssertionSession.shouldBeSet(other: Set, m } } -@Deprecated("This is an experimental part of API. It may be changed or removed in next releases.") +@Deprecated("This is an experimental part of the API. It may be changed or removed in newer releases.") fun > CollectionAssertionSession.shouldBeSet(vararg other: T) { val otherSet = HashSet() for (e in other) {