From c411a8febe8b1f696d9d15a1c2f76a8ff1701f66 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Wed, 7 Dec 2016 12:58:25 +0300 Subject: [PATCH] JS: update tests --- .../codegen/box/binaryOp/overflowInt.kt | 2 -- .../codegen/box/intrinsics/kt12125.kt | 3 --- .../codegen/box/intrinsics/kt12125_inc.kt | 3 --- .../semantics/JsCodegenBoxTestGenerated.java | 24 +++---------------- .../box/inline/metadataForPublicFunction.kt | 10 ++++---- .../inlineMultiModule/callableReference.kt | 2 +- .../box/inlineMultiModule/extensionLambda.kt | 2 +- .../testData/box/inlineMultiModule/lambda.kt | 2 +- .../box/inlineMultiModule/localNameClash.kt | 2 +- .../box/inlineSizeReduction/inlineOrder.kt | 2 +- 10 files changed, 13 insertions(+), 39 deletions(-) diff --git a/compiler/testData/codegen/box/binaryOp/overflowInt.kt b/compiler/testData/codegen/box/binaryOp/overflowInt.kt index 5d01fea8c64..4d5b899987f 100644 --- a/compiler/testData/codegen/box/binaryOp/overflowInt.kt +++ b/compiler/testData/codegen/box/binaryOp/overflowInt.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: JS -// reason - Int doesn't overflow in JS, TODO: include after KT-7733 is fixed fun box(): String { val i1: Int = Int.MAX_VALUE val i2 = i1 + 1 diff --git a/compiler/testData/codegen/box/intrinsics/kt12125.kt b/compiler/testData/codegen/box/intrinsics/kt12125.kt index a369abaeda2..c45ffb3f57c 100644 --- a/compiler/testData/codegen/box/intrinsics/kt12125.kt +++ b/compiler/testData/codegen/box/intrinsics/kt12125.kt @@ -1,6 +1,3 @@ -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - fun test(i: Int): Int { return i } diff --git a/compiler/testData/codegen/box/intrinsics/kt12125_inc.kt b/compiler/testData/codegen/box/intrinsics/kt12125_inc.kt index 13b64619def..f531e713ef5 100644 --- a/compiler/testData/codegen/box/intrinsics/kt12125_inc.kt +++ b/compiler/testData/codegen/box/intrinsics/kt12125_inc.kt @@ -1,6 +1,3 @@ -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - fun test(i: Int): Int { return i } diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index fddab863f19..bd41fb50e75 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -1076,13 +1076,7 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { @TestMetadata("overflowInt.kt") public void testOverflowInt() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/binaryOp/overflowInt.kt"); - try { - doTest(fileName); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + doTest(fileName); } @TestMetadata("overflowLong.kt") @@ -9681,13 +9675,7 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { @TestMetadata("kt12125.kt") public void testKt12125() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/intrinsics/kt12125.kt"); - try { - doTest(fileName); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + doTest(fileName); } @TestMetadata("kt12125_2.kt") @@ -9699,13 +9687,7 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { @TestMetadata("kt12125_inc.kt") public void testKt12125_inc() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/intrinsics/kt12125_inc.kt"); - try { - doTest(fileName); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + doTest(fileName); } @TestMetadata("kt12125_inc_2.kt") diff --git a/js/js.translator/testData/box/inline/metadataForPublicFunction.kt b/js/js.translator/testData/box/inline/metadataForPublicFunction.kt index c0ea216f92d..77b0295e3b9 100644 --- a/js/js.translator/testData/box/inline/metadataForPublicFunction.kt +++ b/js/js.translator/testData/box/inline/metadataForPublicFunction.kt @@ -1,10 +1,10 @@ package foo -// CHECK_CONTAINS_NO_CALLS: test1 -// CHECK_CONTAINS_NO_CALLS: test2 -// CHECK_CONTAINS_NO_CALLS: test3 -// CHECK_CONTAINS_NO_CALLS: test4_buocd8$ -// CHECK_CONTAINS_NO_CALLS: test5 +// CHECK_CONTAINS_NO_CALLS: test1 except=imul +// CHECK_CONTAINS_NO_CALLS: test2 except=imul +// CHECK_CONTAINS_NO_CALLS: test3 except=imul +// CHECK_CONTAINS_NO_CALLS: test4_buocd8$ except=imul +// CHECK_CONTAINS_NO_CALLS: test5 except=imul // CHECK_HAS_INLINE_METADATA: apply // CHECK_HAS_INLINE_METADATA: applyL_hiyix$ // CHECK_HAS_INLINE_METADATA: applyM_hiyix$ diff --git a/js/js.translator/testData/box/inlineMultiModule/callableReference.kt b/js/js.translator/testData/box/inlineMultiModule/callableReference.kt index 6711b832bd4..3c942097ae4 100644 --- a/js/js.translator/testData/box/inlineMultiModule/callableReference.kt +++ b/js/js.translator/testData/box/inlineMultiModule/callableReference.kt @@ -12,7 +12,7 @@ public fun apply(x: T, fn: (T)->R): R = import utils.* -// CHECK_CONTAINS_NO_CALLS: test +// CHECK_CONTAINS_NO_CALLS: test except=imul internal fun multiplyBy2(x: Int): Int = x * 2 diff --git a/js/js.translator/testData/box/inlineMultiModule/extensionLambda.kt b/js/js.translator/testData/box/inlineMultiModule/extensionLambda.kt index 9784f87ab94..a8fee7fc592 100644 --- a/js/js.translator/testData/box/inlineMultiModule/extensionLambda.kt +++ b/js/js.translator/testData/box/inlineMultiModule/extensionLambda.kt @@ -13,7 +13,7 @@ public fun apply(x: T, fn: T.()->R): R = import utils.* -// CHECK_CONTAINS_NO_CALLS: test +// CHECK_CONTAINS_NO_CALLS: test except=imul internal class A(val n: Int) diff --git a/js/js.translator/testData/box/inlineMultiModule/lambda.kt b/js/js.translator/testData/box/inlineMultiModule/lambda.kt index 3891bd75af8..a34342543c1 100644 --- a/js/js.translator/testData/box/inlineMultiModule/lambda.kt +++ b/js/js.translator/testData/box/inlineMultiModule/lambda.kt @@ -13,7 +13,7 @@ public fun apply(x: T, fn: (T)->R): R = import utils.* -// CHECK_CONTAINS_NO_CALLS: test +// CHECK_CONTAINS_NO_CALLS: test except=imul internal fun test(x: Int): Int = apply(x) { it * 2 } diff --git a/js/js.translator/testData/box/inlineMultiModule/localNameClash.kt b/js/js.translator/testData/box/inlineMultiModule/localNameClash.kt index 024c8985275..fca3d58e0f1 100644 --- a/js/js.translator/testData/box/inlineMultiModule/localNameClash.kt +++ b/js/js.translator/testData/box/inlineMultiModule/localNameClash.kt @@ -15,7 +15,7 @@ public fun apply(x: T, fn: (T)->R): R { import utils.* -// CHECK_CONTAINS_NO_CALLS: test +// CHECK_CONTAINS_NO_CALLS: test except=imul internal fun test(x: Int, y: Int): Int = apply(x) { it + 1 } * y diff --git a/js/js.translator/testData/box/inlineSizeReduction/inlineOrder.kt b/js/js.translator/testData/box/inlineSizeReduction/inlineOrder.kt index 9b7528ddd36..227a2cde589 100644 --- a/js/js.translator/testData/box/inlineSizeReduction/inlineOrder.kt +++ b/js/js.translator/testData/box/inlineSizeReduction/inlineOrder.kt @@ -4,7 +4,7 @@ package foo // CHECK_VARS_COUNT: function=test2 count=0 // CHECK_VARS_COUNT: function=test3 count=0 // CHECK_VARS_COUNT: function=test4 count=0 -// CHECK_VARS_COUNT: function=test5 count=0 +// CHECK_VARS_COUNT: function=test5 count=2 var global = "" var globalNum = 1