Skip to content

Commit 6476438

Browse files
committed
Add test expectation
1 parent bc78ec7 commit 6476438

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Tests/AppTests/AnalyzerTests.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,6 +1157,23 @@ extension AllTests.AnalyzerTests {
11571157
}
11581158
}
11591159

1160+
@Test func processingEnvironmentVariable() async throws {
1161+
let environment = QueueIsolated<[String: String]?>(nil)
1162+
try await withDependencies {
1163+
$0.fileManager.fileExists = { _ in true }
1164+
$0.shell.run = { @Sendable _, _, env in
1165+
environment.setValue(env)
1166+
return #"{"name":"foo","products":[],"targets":[]}"#
1167+
}
1168+
} operation: {
1169+
_ = try await Analyze.dumpPackage(at: "/somepath")
1170+
try environment.withValue {
1171+
let keys = try #require($0?.keys)
1172+
#expect(keys.contains("SPI_PROCESSING"))
1173+
}
1174+
}
1175+
}
1176+
11601177
@Test func issue_577() async throws {
11611178
// Duplicate "latest release" versions
11621179
// https://github.com/SwiftPackageIndex/SwiftPackageIndex-Server/issues/577

0 commit comments

Comments
 (0)