mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-21 13:20:56 +07:00
To better highlight that this test framework is for internal usage only. #IDEA-334017 GitOrigin-RevId: c491de2411cdffd6eee3e97a6273982560572f4b
73 lines
3.2 KiB
Kotlin
73 lines
3.2 KiB
Kotlin
package com.intellij.codeInspection.tests.kotlin
|
|
|
|
import com.intellij.jvm.analysis.internal.testFramework.DependencyInspectionTestBase
|
|
|
|
class KotlinDependencyInspectionTest0 : DependencyInspectionTestBase() {
|
|
fun `test illegal imported dependency Java API`() = dependencyViolationTest(javaFooFile, "ImportClientJava.kt", """
|
|
package pkg.client
|
|
|
|
import <error descr="Dependency rule 'Deny usages of scope 'JavaFoo' in scope 'ImportClientJava'.' is violated">pkg.api.JavaFoo</error>
|
|
|
|
fun main() {
|
|
<error descr="Dependency rule 'Deny usages of scope 'JavaFoo' in scope 'ImportClientJava'.' is violated">JavaFoo()</error>
|
|
}
|
|
""".trimIndent())
|
|
|
|
fun `test illegal imported dependency Kotlin API`() = dependencyViolationTest(kotlinFooFile, "ImportClientKotlin.kt", """
|
|
package pkg.client
|
|
|
|
import <error descr="Dependency rule 'Deny usages of scope 'KotlinFoo' in scope 'ImportClientKotlin'.' is violated">pkg.api.KotlinFoo</error>
|
|
|
|
fun main() {
|
|
<error descr="Dependency rule 'Deny usages of scope 'KotlinFoo' in scope 'ImportClientKotlin'.' is violated">KotlinFoo()</error>
|
|
}
|
|
""".trimIndent())
|
|
|
|
fun `test illegal imported dependency skip imports`() = dependencyViolationTest(kotlinFooFile, "ImportClientKotlin.kt", """
|
|
package pkg.client
|
|
|
|
import pkg.api.KotlinFoo
|
|
|
|
fun main() {
|
|
<error descr="Dependency rule 'Deny usages of scope 'KotlinFoo' in scope 'ImportClientKotlin'.' is violated">KotlinFoo()</error>
|
|
}
|
|
""".trimIndent(), skipImports = true)
|
|
|
|
fun `test illegal imported dependency Kotlin API in Java`() = dependencyViolationTest(kotlinFooFile, "ImportClientKotlin.java", """
|
|
package pkg.client;
|
|
|
|
import <error descr="Dependency rule 'Deny usages of scope 'KotlinFoo' in scope 'ImportClientKotlin'.' is violated">pkg.api.KotlinFoo</error>;
|
|
|
|
class Client {
|
|
public static void main(String[] args) {
|
|
new <error descr="Dependency rule 'Deny usages of scope 'KotlinFoo' in scope 'ImportClientKotlin'.' is violated">KotlinFoo</error>();
|
|
}
|
|
}
|
|
""".trimIndent())
|
|
|
|
fun `test illegal fully qualified dependency Java API`() = dependencyViolationTest(javaFooFile, "FqClientJava.kt", """
|
|
package pkg.client
|
|
|
|
fun main() {
|
|
<error descr="Dependency rule 'Deny usages of scope 'JavaFoo' in scope 'FqClientJava'.' is violated">pkg.api.JavaFoo()</error>
|
|
}
|
|
""".trimIndent())
|
|
|
|
fun `test illegal fully qualified dependency Kotlin API`() = dependencyViolationTest(kotlinFooFile, "FqClientKotlin.kt", """
|
|
package pkg.client
|
|
|
|
fun main() {
|
|
<error descr="Dependency rule 'Deny usages of scope 'KotlinFoo' in scope 'FqClientKotlin'.' is violated">pkg.api.KotlinFoo()</error>
|
|
}
|
|
""".trimIndent())
|
|
|
|
fun `test illegal fully qualified dependency Kotlin API in Java`() = dependencyViolationTest(kotlinFooFile, "FqClientKotlin.java", """
|
|
package pkg.client;
|
|
|
|
class Client {
|
|
public static void main(String[] args) {
|
|
new <error descr="Dependency rule 'Deny usages of scope 'KotlinFoo' in scope 'FqClientKotlin'.' is violated">pkg.api.KotlinFoo</error>();
|
|
}
|
|
}
|
|
""".trimIndent())
|
|
} |