Skip to content

Commit 7c0e2a9

Browse files
authored
[test] Add a couple of fixed test cases (#3368)
2 parents e083c7f + efb957f commit 7c0e2a9

1 file changed

Lines changed: 35 additions & 1 deletion

File tree

Tests/SwiftBasicFormatTest/BasicFormatTests.swift

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ final class BasicFormatTest: XCTestCase {
451451
)
452452
}
453453

454-
func testAccessor() {
454+
func testAccessor1() {
455455
let source = """
456456
struct Point {
457457
var computed: Int {
@@ -475,6 +475,40 @@ final class BasicFormatTest: XCTestCase {
475475
)
476476
}
477477

478+
func testAccessor2() {
479+
let source: AccessorDeclSyntax = """
480+
get {
481+
return 1
482+
}
483+
"""
484+
485+
assertFormatted(
486+
tree: source,
487+
expected: """
488+
get {
489+
return 1
490+
}
491+
"""
492+
)
493+
}
494+
495+
func testAccessor3() {
496+
let source: AccessorDeclSyntax = """
497+
get {
498+
return 1
499+
}
500+
"""
501+
502+
assertFormatted(
503+
tree: source,
504+
expected: """
505+
get {
506+
return 1
507+
}
508+
"""
509+
)
510+
}
511+
478512
func testClosureExprParam() {
479513
let source = """
480514
_ = {foo in}

0 commit comments

Comments
 (0)