diff --git a/libraries/stdlib/test/collections/ReversedViewsJVMTest.kt b/libraries/stdlib/test/collections/ReversedViewsJVMTest.kt deleted file mode 100644 index 9d78e7d609b..00000000000 --- a/libraries/stdlib/test/collections/ReversedViewsJVMTest.kt +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2010-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package test.collections - -import kotlin.test.assertEquals -import org.junit.Test as test - -/** - * We need this test to run only on JVM because we have no mutability support by sub-list implementation for JavaScript - */ -class ReversedViewsJVMTest { - - @test fun testMutableSubList() { - val original = arrayListOf(1, 2, 3, 4) - val reversedSubList = original.asReversed().subList(1, 3) - - assertEquals(listOf(3, 2), reversedSubList) - reversedSubList.clear() - assertEquals(emptyList(), reversedSubList) - assertEquals(listOf(1, 4), original) - - reversedSubList.add(100) - assertEquals(listOf(100), reversedSubList) - assertEquals(listOf(1, 100, 4), original) - } - -} diff --git a/libraries/stdlib/test/collections/ReversedViewsTest.kt b/libraries/stdlib/test/collections/ReversedViewsTest.kt index 3d0c5cfd3bb..3c71e925e3c 100644 --- a/libraries/stdlib/test/collections/ReversedViewsTest.kt +++ b/libraries/stdlib/test/collections/ReversedViewsTest.kt @@ -64,6 +64,20 @@ class ReversedViewsTest { assertEquals(listOf(9, 8, 7), reversed.subList(1, 4)) } + @test fun testMutableSubList() { + val original = arrayListOf(1, 2, 3, 4) + val reversedSubList = original.asReversed().subList(1, 3) + + assertEquals(listOf(3, 2), reversedSubList) + reversedSubList.clear() + assertEquals(emptyList(), reversedSubList) + assertEquals(listOf(1, 4), original) + + reversedSubList.add(100) + assertEquals(listOf(100), reversedSubList) + assertEquals(listOf(1, 100, 4), original) + } + @test fun testMutableSimple() { assertEquals(listOf(3, 2, 1), mutableListOf(1, 2, 3).asReversed()) assertEquals(listOf(3, 2, 1), mutableListOf(1, 2, 3).asReversed().toList()) diff --git a/libraries/stdlib/test/properties/delegation/lazy/LazyValuesTest.kt b/libraries/stdlib/test/properties/delegation/lazy/LazyValuesTest.kt index 3f28a21fd7a..97b1c7a1cd9 100644 --- a/libraries/stdlib/test/properties/delegation/lazy/LazyValuesTest.kt +++ b/libraries/stdlib/test/properties/delegation/lazy/LazyValuesTest.kt @@ -16,6 +16,7 @@ class LazyValTest { } } +@JvmVersion class SynchronizedLazyValTest { @Volatile var result = 0 val a by lazy(this) { @@ -24,7 +25,7 @@ class SynchronizedLazyValTest { @test fun doTest() { synchronized(this) { - // thread { a } // not available in js // TODO: Make this test JVM-only + kotlin.concurrent.thread { a } // not available in js result = 1 a }