Skip to content

Commit

Permalink
ParameterListWrappingRule: add test for pinterest#938
Browse files Browse the repository at this point in the history
  • Loading branch information
t-kameyama committed Oct 26, 2020
1 parent b542a81 commit fc7bd3b
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -564,19 +564,32 @@ class ParameterListWrappingRuleTest {
assertThat(ParameterListWrappingRule().format(code)).isEqualTo(code)
}

// https://github.com/pinterest/ktlint/issues/921
@Test
fun `correctly indent primary constructor parameters when class has multiline type parameter`() {
assertThat(
ParameterListWrappingRule().lint(
"""
// https://github.com/pinterest/ktlint/issues/921
class ComposableLambda<
P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16,
P17, P18, R>(
val key: Int,
private val tracked: Boolean,
private val sourceInformation: String?
)
// https://github.com/pinterest/ktlint/issues/938
class GenericTypeWithALongLongALong1
class GenericTypeWithALongLongALong2
class GenericTypeWithALongLongALong3
class ViewModelWithALongLongLongLongLongLongLongLongName3<
A : GenericTypeWithALongLongALong1,
B : GenericTypeWithALongLongALong2,
C : GenericTypeWithALongLongALong3
> constructor(
parameterWithLongLongLongLongLongLongLongLongNameA: A,
parameterWithLongLongLongLongLongLongLongLongNameB: B,
parameterWithLongLongLongLongLongLongLongLongNameC: C
)
""".trimIndent()
)
).isEmpty()
Expand Down

0 comments on commit fc7bd3b

Please # to comment.