Skip to content

Commit

Permalink
Failing test for generics formatting (pinterest#581)
Browse files Browse the repository at this point in the history
  • Loading branch information
swankjesse authored and shashachu committed Sep 16, 2019
1 parent f1aab87 commit 9abdb55
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.pinterest.ktlint.ruleset.standard

import com.pinterest.ktlint.test.diffFileFormat
import com.pinterest.ktlint.test.diffFileLint
import org.assertj.core.api.Assertions.assertThat
import org.junit.Ignore
import org.junit.Test

class SpacingAroundAngleBracketRuleTest {

@Test
@Ignore("https://github.com/pinterest/ktlint/issues/580")
fun testLint() {
assertThat(SpacingAroundRangeOperatorRule().diffFileLint("spec/angle-bracket-spacing/lint.kt.spec")).isEmpty()
}

@Test
@Ignore("https://github.com/pinterest/ktlint/issues/580")
fun testFormat() {
assertThat(
SpacingAroundRangeOperatorRule().diffFileFormat(
"spec/angle-bracket-spacing/format.kt.spec",
"spec/angle-bracket-spacing/format-expected.kt.spec"
)
).isEmpty()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
fun main() {
var a: Map<Int, String> = mapOf()
var b: Map<Int, String> = mapOf()
var c: Map<Int, String> = mapOf()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
fun main() {
var a: Map< Int, String> = mapOf()
var b: Map<Int, String > = mapOf()
var c: Map <Int, String> = mapOf()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
fun main() {
var a: Map< Int, String> = mapOf()
var b: Map<Int, String > = mapOf()
var c: Map <Int, String> = mapOf()
}

// expect
// 2:14:Unexpected spacing after "<"
// 3:25:Unexpected spacing before ">"
// 4:13:Unexpected spacing before "<"

0 comments on commit 9abdb55

Please sign in to comment.