diff --git a/compiler/testData/cli/js/nativeDeclarations.args b/compiler/testData/cli/js/nativeDeclarations.args new file mode 100644 index 00000000000..906adc2ec6d --- /dev/null +++ b/compiler/testData/cli/js/nativeDeclarations.args @@ -0,0 +1,3 @@ +$TESTDATA_DIR$/nativeDeclarations.kt +-output +$TEMP_DIR$/out.js \ No newline at end of file diff --git a/compiler/testData/cli/js/nativeDeclarations.kt b/compiler/testData/cli/js/nativeDeclarations.kt new file mode 100644 index 00000000000..06965517d66 --- /dev/null +++ b/compiler/testData/cli/js/nativeDeclarations.kt @@ -0,0 +1,15 @@ +native +fun foo(a: String): Int = noImpl + +native +class Bar(b: Int, c: Char) { + fun baz(d: Int) {} +} + +native +object Obj { + fun test1(e: String) {} + object Nested { + fun test2(g: Int) {} + } +} \ No newline at end of file diff --git a/compiler/testData/cli/js/nativeDeclarations.out b/compiler/testData/cli/js/nativeDeclarations.out new file mode 100644 index 00000000000..a0aba9318ad --- /dev/null +++ b/compiler/testData/cli/js/nativeDeclarations.out @@ -0,0 +1 @@ +OK \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/jet/cli/KotlincExecutableTestGenerated.java b/compiler/tests/org/jetbrains/jet/cli/KotlincExecutableTestGenerated.java index 5368ad4a933..7c8a411544f 100644 --- a/compiler/tests/org/jetbrains/jet/cli/KotlincExecutableTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/cli/KotlincExecutableTestGenerated.java @@ -191,6 +191,12 @@ public class KotlincExecutableTestGenerated extends AbstractKotlincExecutableTes doJsTest(fileName); } + @TestMetadata("nativeDeclarations.args") + public void testNativeDeclarations() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/cli/js/nativeDeclarations.args"); + doJsTest(fileName); + } + @TestMetadata("outputPostfixFileNotFound.args") public void testOutputPostfixFileNotFound() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/cli/js/outputPostfixFileNotFound.args"); diff --git a/compiler/tests/org/jetbrains/jet/cli/js/K2JsCliTest.java b/compiler/tests/org/jetbrains/jet/cli/js/K2JsCliTest.java index 3c786f8e43b..8480bf0d4c2 100644 --- a/compiler/tests/org/jetbrains/jet/cli/js/K2JsCliTest.java +++ b/compiler/tests/org/jetbrains/jet/cli/js/K2JsCliTest.java @@ -48,4 +48,11 @@ public class K2JsCliTest extends CliBaseTest { public void jsHelp() throws Exception { executeCompilerCompareOutputJS(); } + + @Test + public void nativeDeclarations() throws Exception { + executeCompilerCompareOutputJS(); + + Assert.assertTrue(new File(tmpdir.getTmpDir(), "out.js").isFile()); + } }