Skip to content

Commit 5acf2a2

Browse files
committed
Add more @_package test cases
1 parent 21e1f4c commit 5acf2a2

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Tests/SwiftParserTest/AttributeTests.swift

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,16 @@ final class AttributeTests: XCTestCase {
542542
}
543543

544544
func testPackageAttribute() {
545-
AssertParse(#"@_package(path: "../my-package") import A"#)
546-
AssertParse(#"@_package(url: "https://example.com/package.git", from: "0.0.1") @_exported import A"#)
545+
AssertParse(#"@_package(path: "../my-package", product: "AA") import A"#)
546+
AssertParse(#"@_package(url: "https://example.com/package.git", from: "0.0.1") import A"#)
547+
AssertParse(#"@_package(url: "https://example.com/package.git", .upToNextMinor(from: "0.1.0")) import A"#)
548+
AssertParse(#"@_package(id: "Example.MyPackage", exact: "1.0.0") import A"#)
549+
AssertParse(#"@_package(id: "Example.MyPackage", "0.1.0"..<"0.3.0") import A"#)
550+
AssertParse(
551+
"""
552+
@_package(url: "https://example.com/package.git", from: "0.0.1", product: "AA")
553+
@_exported import A
554+
"""
555+
)
547556
}
548557
}

0 commit comments

Comments
 (0)