Skip to content

Commit fa3697d

Browse files
committed
Chore: Update test cases & reformat
1 parent 71d701b commit fa3697d

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

Sources/SwiftParserDiagnostics/ParseDiagnosticsGenerator.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,6 @@ public class ParseDiagnosticsGenerator: SyntaxAnyVisitor {
384384
return .visitChildren
385385
}
386386

387-
388387
public override func visit(_ node: AccessorEffectSpecifiersSyntax) -> SyntaxVisitorContinueKind {
389388
return handleEffectSpecifiers(node)
390389
}

Tests/SwiftParserTest/DeclarationTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -772,11 +772,11 @@ final class DeclarationTests: XCTestCase {
772772
accessors: AccessorListSyntax([
773773
AccessorDeclSyntax(
774774
accessorKind: .keyword(.get)
775-
)
776-
]),
775+
)
776+
]),
777777
UnexpectedNodesSyntax([
778778
TokenSyntax.identifier("bogus"), TokenSyntax.keyword(.rethrows),
779-
TokenSyntax.identifier("set")
779+
TokenSyntax.identifier("set"),
780780
])
781781
)
782782
),

Tests/SwiftParserTest/translated/EffectfulPropertiesTests.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,12 @@ final class EffectfulPropertiesTests: XCTestCase {
215215
assertParse(
216216
"""
217217
var bad4 : Int = 0 {
218-
willSet(theValue) 3️⃣reasync 4️⃣rethrows 1️⃣async 2️⃣throws {}
218+
willSet(theValue) 1️⃣reasync 2️⃣rethrows async 3️⃣throws {}
219219
}
220220
""",
221221
diagnostics: [
222-
DiagnosticSpec(locationMarker: "1️⃣", message: "'async' conflicts with 'reasync'", notes: [NoteSpec(locationMarker: "3️⃣", message: "'reasync' declared here")], fixIts: ["remove redundant 'async'"]),
223-
DiagnosticSpec(locationMarker: "2️⃣", message: "'throws' conflicts with 'rethrows'", notes: [NoteSpec(locationMarker: "4️⃣", message: "'rethrows' declared here")], fixIts: ["remove redundant 'throws'"]),
222+
DiagnosticSpec(locationMarker: "1️⃣", message: "expected async specifier; did you mean 'async'?", fixIts: ["replace 'reasync' with 'async'"]),
223+
DiagnosticSpec(locationMarker: "2️⃣", message: "'rethrows' conflicts with 'throws'", notes: [NoteSpec(locationMarker: "3️⃣", message: "'throws' declared here")], fixIts: ["remove redundant 'rethrows'"]),
224224
]
225225
)
226226
}
@@ -246,8 +246,7 @@ final class EffectfulPropertiesTests: XCTestCase {
246246
}
247247
""",
248248
diagnostics: [
249-
DiagnosticSpec(locationMarker: "1️⃣", message: "unexpected code 'bogus rethrows' before effect specifiers"),
250-
DiagnosticSpec(locationMarker: "2️⃣", message: "expected throwing specifier; did you mean 'throws'?"),
249+
DiagnosticSpec(locationMarker: "1️⃣", message: "unexpected code 'bogus rethrows' in accessor")
251250
]
252251
)
253252
}

0 commit comments

Comments
 (0)