Something went wrong. Try again.
An auto tiler for macOS
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637import Foundationimport Testing
@testable import ParcelDev
struct PackagingToolsTests { @Test(arguments: [ "check-binaries", "strip-binary-paths", "install-bundle", "bundle-preflight", "check-bundle-signature", "packaging-absolute-path", "packaging-socket-fixture", "unknown", ]) func rejectsMissingArguments(_ command: String) { #expect(throws: DevError.self) { try PackagingTools.run(command, []) } }
@Test func rejectsExtraArgumentsAndMissingSDKOnlyOperands() { #expect(throws: DevError.self) { try PackagingTools.run("check-binaries", ["--sdk-only", "app", "executable"]) } #expect(throws: DevError.self) { try PackagingTools.run("bundle-preflight", ["app", "extra"]) } #expect(throws: DevError.self) { try PackagingTools.run("packaging-absolute-path", ["path", "extra"]) } }
@Test func dispatchesSignatureCheckUsingExplicitFiles() throws { try withPackagingDirectory { directory in let signature = directory.appendingPathComponent("signature.log") let entitlements = directory.appendingPathComponent("entitlements.plist") try Data("TeamIdentifier=ABCDE12345\n".utf8).write(to: signature) try Data().write(to: entitlements) try PackagingTools.run("check-bundle-signature", [signature.path, entitlements.path]) try Data("malformed".utf8).write(to: entitlements) #expect(throws: DevError.self) { try PackagingTools.run("check-bundle-signature", [signature.path, entitlements.path]) } } }}