Skip to content

Commit a4b9fb7

Browse files
Gooolerqurbonzoda
authored andcommitted
Remove redundant public modifiers in test source sets
1 parent 5350160 commit a4b9fb7

File tree

7 files changed

+28
-28
lines changed

7 files changed

+28
-28
lines changed

core/commonTest/src/contract/CollectionBehaviors.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
package tests.contract
77

8-
public fun <T> CompareContext<List<T>>.listBehavior() {
8+
fun <T> CompareContext<List<T>>.listBehavior() {
99
equalityBehavior()
1010
collectionBehavior()
1111
compareProperty( { listIterator() }, { listIteratorBehavior() })
@@ -28,7 +28,7 @@ public fun <T> CompareContext<List<T>>.listBehavior() {
2828
propertyEquals { subList(0, size) }
2929
}
3030

31-
public fun <T> CompareContext<ListIterator<T>>.listIteratorBehavior() {
31+
fun <T> CompareContext<ListIterator<T>>.listIteratorBehavior() {
3232
listIteratorProperties()
3333

3434
while (expected.hasNext()) {
@@ -44,14 +44,14 @@ public fun <T> CompareContext<ListIterator<T>>.listIteratorBehavior() {
4444
propertyFails { previous() }
4545
}
4646

47-
public fun CompareContext<ListIterator<*>>.listIteratorProperties() {
47+
fun CompareContext<ListIterator<*>>.listIteratorProperties() {
4848
propertyEquals { hasNext() }
4949
propertyEquals { hasPrevious() }
5050
propertyEquals { nextIndex() }
5151
propertyEquals { previousIndex() }
5252
}
5353

54-
public fun <T> CompareContext<Iterator<T>>.iteratorBehavior() {
54+
fun <T> CompareContext<Iterator<T>>.iteratorBehavior() {
5555
propertyEquals { hasNext() }
5656

5757
while (expected.hasNext()) {
@@ -61,7 +61,7 @@ public fun <T> CompareContext<Iterator<T>>.iteratorBehavior() {
6161
propertyFails { next() }
6262
}
6363

64-
public fun <T> CompareContext<Set<T>>.setBehavior(objectName: String = "", ordered: Boolean) {
64+
fun <T> CompareContext<Set<T>>.setBehavior(objectName: String = "", ordered: Boolean) {
6565
equalityBehavior(objectName, ordered)
6666
collectionBehavior(objectName, ordered)
6767

@@ -72,7 +72,7 @@ public fun <T> CompareContext<Set<T>>.setBehavior(objectName: String = "", order
7272

7373

7474

75-
public fun <K, V> CompareContext<Map<K, V>>.mapBehavior(ordered: Boolean) {
75+
fun <K, V> CompareContext<Map<K, V>>.mapBehavior(ordered: Boolean) {
7676
propertyEquals { size }
7777
propertyEquals { isEmpty() }
7878
equalityBehavior(ordered = ordered)
@@ -92,7 +92,7 @@ public fun <K, V> CompareContext<Map<K, V>>.mapBehavior(ordered: Boolean) {
9292
}
9393

9494

95-
public fun <T> CompareContext<T>.equalityBehavior(objectName: String = "", ordered: Boolean = true) {
95+
fun <T> CompareContext<T>.equalityBehavior(objectName: String = "", ordered: Boolean = true) {
9696
val prefix = objectName + if (objectName.isNotEmpty()) "." else ""
9797
equals(objectName)
9898
propertyEquals(prefix + "hashCode") { hashCode() }
@@ -101,7 +101,7 @@ public fun <T> CompareContext<T>.equalityBehavior(objectName: String = "", order
101101
}
102102

103103

104-
public fun <T> CompareContext<Collection<T>>.collectionBehavior(objectName: String = "", ordered: Boolean = true) {
104+
fun <T> CompareContext<Collection<T>>.collectionBehavior(objectName: String = "", ordered: Boolean = true) {
105105
val prefix = objectName + if (objectName.isNotEmpty()) "." else ""
106106
propertyEquals (prefix + "size") { size }
107107
propertyEquals (prefix + "isEmpty") { isEmpty() }

core/commonTest/src/contract/ComparisonDSL.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,22 @@ package tests.contract
88
import tests.assertTypeEquals
99
import kotlin.test.*
1010

11-
public fun <T> compare(expected: T, actual: T, block: CompareContext<T>.() -> Unit) {
11+
fun <T> compare(expected: T, actual: T, block: CompareContext<T>.() -> Unit) {
1212
CompareContext(expected, actual).block()
1313
}
1414

15-
public class CompareContext<out T>(public val expected: T, public val actual: T) {
15+
class CompareContext<out T>(val expected: T, val actual: T) {
1616

17-
public fun equals(message: String = "") {
17+
fun equals(message: String = "") {
1818
assertEquals(expected, actual, message)
1919
}
20-
public fun <P> propertyEquals(message: String = "", getter: T.() -> P) {
20+
fun <P> propertyEquals(message: String = "", getter: T.() -> P) {
2121
assertEquals(expected.getter(), actual.getter(), message)
2222
}
23-
public fun propertyFails(getter: T.() -> Unit) { assertFailEquals({expected.getter()}, {actual.getter()}) }
24-
public inline fun <reified E> propertyFailsWith(noinline getter: T.() -> Unit) = propertyFailsWith({ it is E }, getter)
25-
public fun propertyFailsWith(exceptionPredicate: (Throwable) -> Boolean, getter: T.() -> Unit) { assertFailEquals({expected.getter()}, {actual.getter()}, exceptionPredicate) }
26-
public fun <P> compareProperty(getter: T.() -> P, block: CompareContext<P>.() -> Unit) {
23+
fun propertyFails(getter: T.() -> Unit) { assertFailEquals({expected.getter()}, {actual.getter()}) }
24+
inline fun <reified E> propertyFailsWith(noinline getter: T.() -> Unit) = propertyFailsWith({ it is E }, getter)
25+
fun propertyFailsWith(exceptionPredicate: (Throwable) -> Boolean, getter: T.() -> Unit) { assertFailEquals({expected.getter()}, {actual.getter()}, exceptionPredicate) }
26+
fun <P> compareProperty(getter: T.() -> P, block: CompareContext<P>.() -> Unit) {
2727
compare(expected.getter(), actual.getter(), block)
2828
}
2929

core/commonTest/src/testUtils.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ internal fun <K, V> MutableMap<K, V>.remove(key: K, value: V): Boolean =
2020
false
2121
}
2222

23-
public expect fun assertTypeEquals(expected: Any?, actual: Any?)
23+
expect fun assertTypeEquals(expected: Any?, actual: Any?)
2424

25-
public enum class TestPlatform {
25+
enum class TestPlatform {
2626
JVM,
2727
JS,
2828
Native,
2929
Wasm,
3030
}
31-
public expect val currentPlatform: TestPlatform
31+
expect val currentPlatform: TestPlatform
3232

33-
public inline fun testOn(platform: TestPlatform, action: () -> Unit) {
33+
inline fun testOn(platform: TestPlatform, action: () -> Unit) {
3434
if (platform == currentPlatform) action()
3535
}
3636

core/jsTest/src/testUtilsJs.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ package tests
77

88
import kotlin.test.assertEquals
99

10-
public actual fun assertTypeEquals(expected: Any?, actual: Any?) {
10+
actual fun assertTypeEquals(expected: Any?, actual: Any?) {
1111
assertEquals(expected?.let { it::class.js }, actual?.let { it::class.js })
1212
}
1313

14-
public actual val currentPlatform: TestPlatform get() = TestPlatform.JS
14+
actual val currentPlatform: TestPlatform get() = TestPlatform.JS
1515

1616
actual object NForAlgorithmComplexity {
1717
actual val O_N: Int = 500_000

core/jvmTest/src/testUtilsJvm.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ package tests
77

88
import kotlin.test.assertEquals
99

10-
public actual fun assertTypeEquals(expected: Any?, actual: Any?) {
10+
actual fun assertTypeEquals(expected: Any?, actual: Any?) {
1111
assertEquals(expected?.javaClass, actual?.javaClass)
1212
}
1313

14-
public actual val currentPlatform: TestPlatform get() = TestPlatform.JVM
14+
actual val currentPlatform: TestPlatform get() = TestPlatform.JVM
1515

1616
actual object NForAlgorithmComplexity {
1717
actual val O_N: Int = 1_000_000

core/nativeTest/src/testUtilsNative.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ package tests
77

88
import kotlin.test.assertTrue
99

10-
public actual fun assertTypeEquals(expected: Any?, actual: Any?) {
10+
actual fun assertTypeEquals(expected: Any?, actual: Any?) {
1111
if (expected != null && actual != null) {
1212
assertTrue(expected::class.isInstance(actual) || actual::class.isInstance(expected),
1313
"Expected: $expected, Actual: $actual")
@@ -16,7 +16,7 @@ public actual fun assertTypeEquals(expected: Any?, actual: Any?) {
1616
}
1717
}
1818

19-
public actual val currentPlatform: TestPlatform get() = TestPlatform.Native
19+
actual val currentPlatform: TestPlatform get() = TestPlatform.Native
2020

2121
actual object NForAlgorithmComplexity {
2222
actual val O_N: Int = 100_000

core/wasmTest/src/testUtilsJs.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ package tests
77

88
import kotlin.test.assertTrue
99

10-
public actual fun assertTypeEquals(expected: Any?, actual: Any?) {
10+
actual fun assertTypeEquals(expected: Any?, actual: Any?) {
1111
if (expected != null && actual != null) {
1212
assertTrue(expected::class.isInstance(actual) || actual::class.isInstance(expected),
1313
"Expected: $expected, Actual: $actual")
@@ -16,7 +16,7 @@ public actual fun assertTypeEquals(expected: Any?, actual: Any?) {
1616
}
1717
}
1818

19-
public actual val currentPlatform: TestPlatform get() = TestPlatform.Wasm
19+
actual val currentPlatform: TestPlatform get() = TestPlatform.Wasm
2020

2121
actual object NForAlgorithmComplexity {
2222
actual val O_N: Int = 500_000

0 commit comments

Comments
 (0)