Skip to content

Commit ceb77a2

Browse files
authored
Tests #678: malformed struct (#711)
1 parent 741b5c0 commit ceb77a2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Tests/SwiftParserTest/Declarations.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,19 @@ final class DeclarationTests: XCTestCase {
682682
]
683683
)
684684
}
685+
686+
func testMalforedStruct() {
687+
AssertParse(
688+
"""
689+
struct n#^OPENINGBRACES^##if@#^ENDIF^##^CLOSINGBRACES^#
690+
""",
691+
diagnostics: [
692+
DiagnosticSpec(locationMarker: "OPENINGBRACES", message: "Expected '{' to start struct"),
693+
DiagnosticSpec(locationMarker: "ENDIF", message: "Expected '#endif' in conditional compilation block"),
694+
DiagnosticSpec(locationMarker: "CLOSINGBRACES", message: "Expected '}' to end struct")
695+
]
696+
)
697+
}
685698
}
686699

687700
extension Parser.DeclAttributes {

0 commit comments

Comments
 (0)