Skip to content

Commit

Permalink
Clean up package manifest generator tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jbelkins committed Nov 5, 2024
1 parent 01b3800 commit 3c5b103
Showing 1 changed file with 16 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,32 @@ class PackageManifestGeneratorTests {
packageManifest.shouldStartWith("// swift-tools-version: 5.5.0")
}

@Test
fun `it renders package manifest file with macOS and iOS platforms block`() {
val packageManifest = testContext.manifest.getFileString("Package.swift").get()
val packageManifest = testContext.manifest.getFileString("Package.swift.txt").get()
assertNotNull(packageManifest)
packageManifest.shouldContain(
"platforms: [\n" +
" .macOS(.v10_15), .iOS(.v13)\n" +
" ]"
)
val expected = """
platforms: [
.macOS(.v10_15), .iOS(.v13)
],
"""
packageManifest.shouldContain(expected)
}

@Test
fun `it renders package manifest file with single library in product block`() {
val packageManifest = testContext.manifest.getFileString("Package.swift.txt").get()
assertNotNull(packageManifest)
packageManifest.shouldContain(
"products: [\n" +
" .library(name: \"MockSDK\", targets: [\"MockSDK\"])\n" +
" ]"
)
val expected = """
products: [
.library(name: "MockSDK", targets: ["MockSDK"])
],
"""
packageManifest.shouldContain(expected)
}

@Test
fun `it renders package manifest file with target and test target`() {
println(testContext.manifest.files)
val packageManifest = testContext.manifest.getFileString("Package.swift.txt").get()
assertNotNull(packageManifest)
val expected = """
Expand All @@ -67,7 +69,8 @@ class PackageManifestGeneratorTests {
),
]
)
]"""
]
"""
packageManifest.shouldContain(expected)
}

Expand Down

0 comments on commit 3c5b103

Please sign in to comment.