forked from pinterest/ktlint
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Failing test for generics formatting (pinterest#581)
- Loading branch information
1 parent
f1aab87
commit 9abdb55
Showing
4 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
...rc/test/kotlin/com/pinterest/ktlint/ruleset/standard/SpacingAroundAngleBracketRuleTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
...nt-ruleset-standard/src/test/resources/spec/angle-bracket-spacing/format-expected.kt.spec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} |
5 changes: 5 additions & 0 deletions
5
ktlint-ruleset-standard/src/test/resources/spec/angle-bracket-spacing/format.kt.spec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} |
10 changes: 10 additions & 0 deletions
10
ktlint-ruleset-standard/src/test/resources/spec/angle-bracket-spacing/lint.kt.spec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "<" |