Skip to content

Commit

Permalink
Add @Lifetime tests
Browse files Browse the repository at this point in the history
  • Loading branch information
meg-gupta committed Oct 10, 2024
1 parent e6352d5 commit 46af7cc
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Tests/SwiftParserTest/AttributeTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1053,4 +1053,25 @@ final class AttributeTests: ParserTestCase {
"""
)
}

func testLifetimeAttribute() {
assertParse(
"""
@lifetime(ne)
func foo(_ ne: NE) -> NE { ne }
"""
)
assertParse(
"""
@lifetime(neOut: neIn)
func foo(_ neOut: inout NE, _ neIn: NE) { neOut = neIn }
"""
)
assertParse(
"""
@lifetime(borrow ne)
func foo(_ ne: NE) -> NE { ne }
"""
)
}
}

0 comments on commit 46af7cc

Please sign in to comment.