Add testcases to ColonRule.description

This commit is contained in:
Manabu Nakazawa
2018-01-16 01:31:09 +09:00
parent e2bd9f8ed8
commit daeb13c2bb
2 changed files with 36 additions and 3 deletions
+24
View File
@@ -1167,6 +1167,18 @@ object.method(5, y: "string")
```
```swift
func abc() { def(ghi: jkl) }
```
```swift
func abc(def: Void) { ghi(jkl: mno) }
```
```swift
class ABC { let def = ghi(jkl: mno) } }
```
</details>
<details>
<summary>Triggering Examples</summary>
@@ -1391,6 +1403,18 @@ object.method(x↓: 5, y: "string")
```
```swift
func abc() { def(ghi:jkl) }
```
```swift
func abc(def: Void) { ghi(jkl:mno) }
```
```swift
class ABC { let def = ghi(jkl:mno) } }
```
</details>
@@ -58,7 +58,10 @@ public struct ColonRule: CorrectableRule, ConfigurationProviderRule {
"object.method(x: 5, y: \"string\")\n",
"object.method(x: 5, y:\n" +
" \"string\")",
"object.method(5, y: \"string\")\n"
"object.method(5, y: \"string\")\n",
"func abc() { def(ghi: jkl) }",
"func abc(def: Void) { ghi(jkl: mno) }",
"class ABC { let def = ghi(jkl: mno) } }"
],
triggeringExamples: [
"let ↓abc:Void\n",
@@ -104,7 +107,10 @@ public struct ColonRule: CorrectableRule, ConfigurationProviderRule {
"class Foo<↓T : Equatable> {}\n",
"object.method(x: 5, y↓ : \"string\")\n",
"object.method(x↓:5, y: \"string\")\n",
"object.method(x↓: 5, y: \"string\")\n"
"object.method(x↓: 5, y: \"string\")\n",
"func abc() { def(ghi↓:jkl) }",
"func abc(def: Void) { ghi(jkl↓:mno) }",
"class ABC { let def = ghi(jkl↓:mno) } }"
],
corrections: [
"let ↓abc:Void\n": "let abc: Void\n",
@@ -150,7 +156,10 @@ public struct ColonRule: CorrectableRule, ConfigurationProviderRule {
"class Foo<↓T : Equatable> {}\n": "class Foo<T: Equatable> {}\n",
"object.method(x: 5, y↓ : \"string\")\n": "object.method(x: 5, y: \"string\")\n",
"object.method(x↓:5, y: \"string\")\n": "object.method(x: 5, y: \"string\")\n",
"object.method(x↓: 5, y: \"string\")\n": "object.method(x: 5, y: \"string\")\n"
"object.method(x↓: 5, y: \"string\")\n": "object.method(x: 5, y: \"string\")\n",
"func abc() { def(ghi↓:jkl) }": "func abc() { def(ghi: jkl) }",
"func abc(def: Void) { ghi(jkl↓:mno) }": "func abc(def: Void) { ghi(jkl: mno) }",
"class ABC { let def = ghi(jkl↓:mno) } }": "class ABC { let def = ghi(jkl: mno) } }"
]
)