Skip to content

Commit 5cb2987

Browse files
committed
Add two extra test cases
1 parent 5340511 commit 5cb2987

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

Tests/SwiftParserTest/translated/OperatorDeclTests.swift

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,29 @@ final class OperatorDeclTests: XCTestCase {
479479
]
480480
)
481481
}
482+
483+
func testOperatorDecl124() {
484+
assertParse(
485+
"""
486+
1️⃣@objc
487+
postfix operator ++: PrecedenceGroup
488+
""",
489+
diagnostics: [
490+
DiagnosticSpec(message: "unexpected code '@objc' before operator declaration")
491+
]
492+
)
493+
}
494+
495+
func testOperatorDecl125() {
496+
assertParse(
497+
"""
498+
1️⃣mutating postfix operator --: UndefinedPrecedenceGroup
499+
""",
500+
diagnostics: [
501+
DiagnosticSpec(message: "unexpected code 'mutating' before operator declaration")
502+
]
503+
)
504+
}
482505

483506
func testIdentifierAsOperatorName() {
484507
assertParse(

0 commit comments

Comments
 (0)