[tests][FIR][checkers][Wasm] Add test data for KT-66475

This commit is contained in:
Stanislav Ruban
2024-03-11 03:53:41 +02:00
committed by Space Team
parent bf77cc3d0c
commit 4d17a908e2
4 changed files with 58 additions and 0 deletions
@@ -0,0 +1,13 @@
// MODULE: commonwasm
// TARGET_PLATFORM: Wasm
// FILE: commonwasm.kt
expect interface ExternalInterface
external fun externalFunction(arg: <!WRONG_JS_INTEROP_TYPE!>ExternalInterface<!>)
// MODULE: wasm()()(commonwasm)
// TARGET_PLATFORM: Wasm
// FILE: wasm.kt
actual external interface ExternalInterface
@@ -0,0 +1,13 @@
// MODULE: commonwasm
// TARGET_PLATFORM: Wasm
// FILE: commonwasm.kt
expect interface <!NO_ACTUAL_FOR_EXPECT!>ExternalInterface<!>
external fun externalFunction(<!WRONG_JS_INTEROP_TYPE!>arg: ExternalInterface<!>)
// MODULE: wasm()()(commonwasm)
// TARGET_PLATFORM: Wasm
// FILE: wasm.kt
actual external interface ExternalInterface
@@ -238,6 +238,22 @@ public class DiagnosticsFirWasmTestGenerated extends AbstractDiagnosticsFirWasmT
}
}
@Nested
@TestMetadata("compiler/testData/diagnostics/wasmTests/multiplatform")
@TestDataPath("$PROJECT_ROOT")
public class Multiplatform {
@Test
@TestMetadata("ActualExternalTypeAsJsInteropType.kt")
public void testActualExternalTypeAsJsInteropType() {
runTest("compiler/testData/diagnostics/wasmTests/multiplatform/ActualExternalTypeAsJsInteropType.kt");
}
@Test
public void testAllFilesPresentInMultiplatform() {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/wasmTests/multiplatform"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
}
@Nested
@TestMetadata("compiler/testData/diagnostics/wasmTests/wasmInterop")
@TestDataPath("$PROJECT_ROOT")
@@ -238,6 +238,22 @@ public class DiagnosticsWasmTestGenerated extends AbstractDiagnosticsWasmTest {
}
}
@Nested
@TestMetadata("compiler/testData/diagnostics/wasmTests/multiplatform")
@TestDataPath("$PROJECT_ROOT")
public class Multiplatform {
@Test
@TestMetadata("ActualExternalTypeAsJsInteropType.kt")
public void testActualExternalTypeAsJsInteropType() {
runTest("compiler/testData/diagnostics/wasmTests/multiplatform/ActualExternalTypeAsJsInteropType.kt");
}
@Test
public void testAllFilesPresentInMultiplatform() {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/wasmTests/multiplatform"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
}
@Nested
@TestMetadata("compiler/testData/diagnostics/wasmTests/wasmInterop")
@TestDataPath("$PROJECT_ROOT")