KotlinLanguageInjector: "kotlin" injections in annotations handled by injectWithCall

This commit is contained in:
Nicolay Mitropolsky
2018-02-28 13:52:11 +03:00
parent fd4f4ef853
commit 08c41474af
2 changed files with 20 additions and 3 deletions
@@ -463,6 +463,21 @@ class KotlinInjectionTest : AbstractInjectionTest() {
)
}
fun testKotlinNestedAnnotationsPattern() {
doAnnotationInjectionTest(
patternLanguage = "kotlin",
injectedLanguage = RegExpLanguage.INSTANCE.id,
pattern = """kotlinParameter().ofFunction(0, kotlinFunction().withName("Matches").definedInClass("Matches"))""",
kotlinCode = """
annotation class Matches(val pattern: String)
annotation class ManyMatches(val patterns: Array<Matches>)
@ManyMatches(patterns = [Matches("[A-Z]<caret>[a-z]+")])
val name = "John"
"""
)
}
fun testKotlinAnnotationsPatternNamed() {
doAnnotationInjectionTest(
patternLanguage = "kotlin",