Rearrange stdlib unit tests across packages.

Rearrange JS stdlib unit tests.
This commit is contained in:
Ilya Gorbunov
2016-06-17 00:13:05 +03:00
parent d266f546f4
commit c5a208f3eb
33 changed files with 57 additions and 80 deletions
@@ -1,12 +1,13 @@
package test.collections
package test.exceptions
import kotlin.test.*
import test.collections.assertArrayNotSameButEquals
import org.junit.Test as test
import java.io.PrintWriter
import java.io.*
class ExceptionTest {
class ExceptionJVMTest {
@test fun printStackTraceOnRuntimeException() {
assertPrintStackTrace(RuntimeException("Crikey!"))
+1 -1
View File
@@ -1,4 +1,4 @@
package test.compare
package test.comparisons
import java.util.*
import kotlin.test.*
@@ -17,7 +17,7 @@
package test.collections
import test.collections.behaviors.listBehavior
import test.compare.STRING_CASE_INSENSITIVE_ORDER
import test.comparisons.STRING_CASE_INSENSITIVE_ORDER
import java.util.*
import kotlin.test.*
import org.junit.Test as test
@@ -22,11 +22,11 @@ class CollectionJVMTest {
@test fun removeAllWithDifferentEquality() {
val data = listOf(IdentityData(1), IdentityData(1))
val list = data.toArrayList()
val list = data.toMutableList()
list -= identitySetOf(data[0]) as Iterable<IdentityData>
assertTrue(list.single() === data[1], "Identity contains should be used")
val list2 = data.toArrayList()
val list2 = data.toMutableList()
list2 -= hashSetOf(data[0]) as Iterable<IdentityData>
assertTrue(list2.isEmpty(), "Equality contains should be used")
@@ -20,8 +20,7 @@ import java.util.*
import kotlin.test.*
import org.junit.Test as test
import test.collections.behaviors.*
import test.compare.STRING_CASE_INSENSITIVE_ORDER
import java.io.Serializable
import test.comparisons.STRING_CASE_INSENSITIVE_ORDER
import kotlin.comparisons.*
class CollectionTest {
@@ -762,11 +761,11 @@ class CollectionTest {
@test fun sortInPlace() {
val data = listOf(11, 3, 7)
val asc = data.toArrayList()
val asc = data.toMutableList()
asc.sort()
assertEquals(listOf(3, 7, 11), asc)
val desc = data.toArrayList()
val desc = data.toMutableList()
desc.sortDescending()
assertEquals(listOf(11, 7, 3), desc)
}
@@ -15,7 +15,7 @@ class MutableCollectionTest {
}
fun <T> testOperation(before: List<T>, after: List<T>, expectedModified: Boolean)
= testOperation(before, after, expectedModified, { it.toArrayList() })
= testOperation(before, after, expectedModified, { it.toMutableList() })
@test fun addAll() {
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package collections
package test.collections
import kotlin.test.assertEquals
import org.junit.Test as test
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package collections
package test.collections
import test.collections.behaviors.listBehavior
import test.collections.compare
+1 -1
View File
@@ -1,5 +1,5 @@
// this package referenced from testArrayScriptTest
package jstest
package test.collections.js
fun testSize(): Int {
val a1 = arrayOf<String>()
+1 -1
View File
@@ -1,4 +1,4 @@
package test.collections
package test.collections.js
import org.junit.Test as test
import kotlin.test.*
@@ -1,4 +1,4 @@
package test.collections
package test.collections.js
import java.util.*
@@ -8,7 +8,7 @@ import kotlin.comparisons.*
fun <T> List<T>.toArrayList() = this.toCollection(ArrayList<T>())
class JavautilCollectionsTest {
class JsCollectionsTest {
val TEST_LIST = arrayOf(2, 0, 9, 7, 1).toList()
val SORTED_TEST_LIST = arrayOf(0, 1, 2, 7, 9).toList()
val MAX_ELEMENT = 9
+4 -4
View File
@@ -1,10 +1,10 @@
package test.collections
package test.collections.js
import test.collections.behaviors.mapBehavior
import kotlin.test.*
import java.util.*
import org.junit.Test as test
import java.util.*
import test.collections.*
import test.collections.behaviors.*
class ComplexMapJsTest : MapJsTest() {
// Helper function with generic parameter to force to use ComlpexHashMap
+3 -2
View File
@@ -1,8 +1,9 @@
package test.collections
package test.collections.js
import kotlin.test.*
import org.junit.Test
import test.collections.behaviors.setBehavior
import test.collections.*
import test.collections.behaviors.*
import java.util.HashSet
import java.util.LinkedHashSet
@@ -1,9 +1,9 @@
package test.collections
package test.language
import org.junit.Test as test
import kotlin.test.*
class NaturalLanguageTest {
class EscapedTestNamesTest {
@test fun `strings equal`() {
val actual = "abc"
@@ -1,8 +1,9 @@
package test
package test.numbers
import kotlin.test.*
import org.junit.Test as test
// TODO: Run these tests during compiler test only (JVM & JS)
class BitwiseOperationsTest {
@test fun orForInt() {
assertEquals(3, 2 or 1)
@@ -20,7 +20,7 @@ import kotlin.test.*
import org.junit.Test as test
class CompanionObjectsExtensionsTest {
class CompanionIntrinsicObjectsJVMTest {
@test fun intTest() {
val i = Int
@@ -1,4 +1,4 @@
package test.collections
package test.numbers
import java.math.BigInteger
import java.math.BigDecimal
@@ -1,4 +1,4 @@
package numbers
package test.numbers
import java.math.BigDecimal
import org.junit.Test as test
+1 -1
View File
@@ -1,4 +1,4 @@
package numbers
package test.numbers
import org.junit.Test as test
import kotlin.test.*
@@ -1,4 +1,4 @@
package numbers
package test.ranges
import org.junit.Test
import org.junit.Test as test
@@ -1,4 +1,4 @@
package language
package test.ranges
import org.junit.Test
import kotlin.test.assertEquals
@@ -1,5 +1,4 @@
@file: Suppress("DEPRECATION_ERROR")
package language
package test.ranges
import java.lang.Integer.MAX_VALUE as MaxI
import java.lang.Integer.MIN_VALUE as MinI
@@ -1,5 +1,4 @@
@file: Suppress("DEPRECATION_ERROR")
package language
package test.ranges
import org.junit.Test as test
import kotlin.test.*
@@ -1,5 +1,4 @@
@file: Suppress("DEPRECATION_ERROR")
package language
package test.ranges
import kotlin.ranges.LongProgression.Companion
import java.lang.Double as jDouble
@@ -1,5 +1,4 @@
@file: Suppress("DEPRECATION_ERROR")
package language
package test.ranges
import kotlin.test.*
import org.junit.Test as test
@@ -1,4 +1,4 @@
package test.annotations
package test.reflection
import kotlin.test.*
import org.junit.Test as test
@@ -1,9 +1,9 @@
package test.collections
package test.utils
import org.junit.Test as test
import kotlin.test.*
class PreconditionsTest() {
class PreconditionsJVMTest() {
@test fun passingRequire() {
require(true)