From a4987ea5bbcb82dc68ab97f338b918254155624d Mon Sep 17 00:00:00 2001 From: Robert Widmann Date: Sun, 12 Jun 2016 22:51:26 -0700 Subject: [PATCH] Update for fileprivate --- Sources/Basic/ByteString.swift | 2 +- Sources/Basic/FSProxy.swift | 10 +++++----- Sources/Basic/OutputByteStream.swift | 18 +++++++++--------- Sources/Basic/TOML.swift | 10 +++++----- .../Build/Command.compile(ClangModule).swift | 2 +- Sources/Build/describe().swift | 2 +- Sources/Commands/SwiftBuildTool.swift | 10 +++++----- Sources/Commands/SwiftPackageTool.swift | 6 +++--- Sources/Commands/SwiftTestTool.swift | 8 ++++---- Sources/Commands/init.swift | 2 +- Sources/Commands/show-dependencies.swift | 8 ++++---- Sources/Get/Package.swift | 2 +- Sources/Get/PackagesDirectory.swift | 2 +- Sources/PackageLoading/Manifest+parse.swift | 6 +++--- Sources/PackageLoading/Module+PkgConfig.swift | 4 ++-- .../PackageLoading/ModuleMapGeneration.swift | 2 +- Sources/PackageLoading/PackageExtensions.swift | 4 ++-- Sources/PackageLoading/transmute.swift | 2 +- Sources/SourceControl/CheckoutManager.swift | 12 ++++++------ Sources/SourceControl/GitRepository.swift | 2 +- Sources/Utility/Path.swift | 2 +- Sources/Utility/walk.swift | 8 ++++---- Tests/Get/VersionGraphTests.swift | 6 +++--- .../PackageLoading/ModuleDependencyTests.swift | 6 +++--- Tests/SourceControl/CheckoutManagerTests.swift | 4 ++-- 25 files changed, 70 insertions(+), 70 deletions(-) diff --git a/Sources/Basic/ByteString.swift b/Sources/Basic/ByteString.swift index 5635a397ac8..cb22f32c343 100644 --- a/Sources/Basic/ByteString.swift +++ b/Sources/Basic/ByteString.swift @@ -23,7 +23,7 @@ /// and then convert to a `ByteString` when complete. public struct ByteString: ArrayLiteralConvertible { /// The buffer contents. - private var _bytes: [UInt8] + fileprivate var _bytes: [UInt8] /// Create an empty byte string. public init() { diff --git a/Sources/Basic/FSProxy.swift b/Sources/Basic/FSProxy.swift index 046fce41328..7a55c5f74b4 100644 --- a/Sources/Basic/FSProxy.swift +++ b/Sources/Basic/FSProxy.swift @@ -63,7 +63,7 @@ public enum FSProxyError: ErrorProtocol { case unknownOSError } -private extension FSProxyError { +fileprivate extension FSProxyError { init(errno: Int32) { switch errno { case libc.EACCES: @@ -131,7 +131,7 @@ public extension FSProxy { } /// Concrete FSProxy implementation which communicates with the local file system. -private class LocalFS: FSProxy { +fileprivate class LocalFS: FSProxy { func exists(_ path: String) -> Bool { return (try? stat(path)) != nil } @@ -268,7 +268,7 @@ private class LocalFS: FSProxy { // // FIXME: This class does not yet support concurrent mutation safely. public class PseudoFS: FSProxy { - private class Node { + fileprivate class Node { /// The actual node data. let contents: NodeContents @@ -276,11 +276,11 @@ public class PseudoFS: FSProxy { self.contents = contents } } - private enum NodeContents { + fileprivate enum NodeContents { case File(ByteString) case Directory(DirectoryContents) } - private class DirectoryContents { + fileprivate class DirectoryContents { var entries: [String: Node] init(entries: [String: Node] = [:]) { diff --git a/Sources/Basic/OutputByteStream.swift b/Sources/Basic/OutputByteStream.swift index 0e92e9b27e8..bf51448709f 100644 --- a/Sources/Basic/OutputByteStream.swift +++ b/Sources/Basic/OutputByteStream.swift @@ -251,7 +251,7 @@ extension String: ByteStreamable { // MARK: Formatted Streaming Output // Not nested because it is generic. -private struct SeparatedListStreamable: ByteStreamable { +fileprivate struct SeparatedListStreamable: ByteStreamable { let items: [T] let separator: String @@ -268,7 +268,7 @@ private struct SeparatedListStreamable: ByteStreamable { } // Not nested because it is generic. -private struct TransformedSeparatedListStreamable: ByteStreamable { +fileprivate struct TransformedSeparatedListStreamable: ByteStreamable { let items: [T] let transform: (T) -> ByteStreamable let separator: String @@ -282,7 +282,7 @@ private struct TransformedSeparatedListStreamable: ByteStreamable { } // Not nested because it is generic. -private struct JSONEscapedTransformedStringListStreamable: ByteStreamable { +fileprivate struct JSONEscapedTransformedStringListStreamable: ByteStreamable { let items: [T] let transform: (T) -> String @@ -302,7 +302,7 @@ public struct Format { static public func asJSON(_ value: Bool) -> ByteStreamable { return JSONEscapedBoolStreamable(value: value) } - private struct JSONEscapedBoolStreamable: ByteStreamable { + fileprivate struct JSONEscapedBoolStreamable: ByteStreamable { let value: Bool func write(to stream: OutputByteStream) { @@ -314,7 +314,7 @@ public struct Format { static public func asJSON(_ value: Int) -> ByteStreamable { return JSONEscapedIntStreamable(value: value) } - private struct JSONEscapedIntStreamable: ByteStreamable { + fileprivate struct JSONEscapedIntStreamable: ByteStreamable { let value: Int func write(to stream: OutputByteStream) { @@ -327,7 +327,7 @@ public struct Format { static public func asJSON(_ value: Double) -> ByteStreamable { return JSONEscapedDoubleStreamable(value: value) } - private struct JSONEscapedDoubleStreamable: ByteStreamable { + fileprivate struct JSONEscapedDoubleStreamable: ByteStreamable { let value: Double func write(to stream: OutputByteStream) { @@ -342,7 +342,7 @@ public struct Format { static public func asJSON(_ string: String) -> ByteStreamable { return JSONEscapedStringStreamable(value: string) } - private struct JSONEscapedStringStreamable: ByteStreamable { + fileprivate struct JSONEscapedStringStreamable: ByteStreamable { let value: String func write(to stream: OutputByteStream) { @@ -358,7 +358,7 @@ public struct Format { static public func asJSON(_ items: [String]) -> ByteStreamable { return JSONEscapedStringListStreamable(items: items) } - private struct JSONEscapedStringListStreamable: ByteStreamable { + fileprivate struct JSONEscapedStringListStreamable: ByteStreamable { let items: [String] func write(to stream: OutputByteStream) { @@ -375,7 +375,7 @@ public struct Format { static public func asJSON(_ items: [String: String]) -> ByteStreamable { return JSONEscapedDictionaryStreamable(items: items) } - private struct JSONEscapedDictionaryStreamable: ByteStreamable { + fileprivate struct JSONEscapedDictionaryStreamable: ByteStreamable { let items: [String: String] func write(to stream: OutputByteStream) { diff --git a/Sources/Basic/TOML.swift b/Sources/Basic/TOML.swift index ccd3648cc49..c053b991fca 100644 --- a/Sources/Basic/TOML.swift +++ b/Sources/Basic/TOML.swift @@ -84,7 +84,7 @@ public func ==(lhs: TOMLItem, rhs: TOMLItem) -> Bool { // MARK: Lexer /// Extensions to check TOML character classes. -private extension UInt8 { +fileprivate extension UInt8 { /// Check if this is a space. func isSpace() -> Bool { return self == UInt8(ascii: " ") || self == UInt8(ascii: "\t") @@ -136,8 +136,8 @@ private extension UInt8 { /// A basic TOML lexer. /// /// This implementation doesn't yet support multi-line strings. -private struct Lexer { - private enum Token { +fileprivate struct Lexer { + fileprivate enum Token { /// Any comment. case comment /// Any whitespace. @@ -355,7 +355,7 @@ extension Lexer.Token : CustomStringConvertible { } } -private struct LexerTokenGenerator : IteratorProtocol { +fileprivate struct LexerTokenGenerator : IteratorProtocol { var lexer: Lexer mutating func next() -> Lexer.Token? { @@ -405,7 +405,7 @@ private func ==(lhs: Lexer.Token, rhs: Lexer.Token) -> Bool { // MARK: Parser -private struct Parser { +fileprivate struct Parser { /// The lexer in use. private var lexer: Lexer diff --git a/Sources/Build/Command.compile(ClangModule).swift b/Sources/Build/Command.compile(ClangModule).swift index 697b4932b11..ee610a942ef 100644 --- a/Sources/Build/Command.compile(ClangModule).swift +++ b/Sources/Build/Command.compile(ClangModule).swift @@ -12,7 +12,7 @@ import PackageModel import Utility import POSIX -private extension ClangModule { +fileprivate extension ClangModule { func includeFlagsWithExternalModules(_ externalModules: Set) -> [String] { var args: [String] = [] for case let dep as ClangModule in dependencies { diff --git a/Sources/Build/describe().swift b/Sources/Build/describe().swift index a77eaff3cf4..6fbe823fa8f 100644 --- a/Sources/Build/describe().swift +++ b/Sources/Build/describe().swift @@ -103,7 +103,7 @@ private func write(path: String, write: (OutputByteStream) -> Void) throws -> St return path } -private struct Targets { +fileprivate struct Targets { var test = Target(node: "test", cmds: []) var main = Target(node: "main", cmds: []) diff --git a/Sources/Commands/SwiftBuildTool.swift b/Sources/Commands/SwiftBuildTool.swift index 43d7f5f6ac2..8d715fd5d0c 100644 --- a/Sources/Commands/SwiftBuildTool.swift +++ b/Sources/Commands/SwiftBuildTool.swift @@ -29,7 +29,7 @@ import func POSIX.chdir /// Additional conformance for our Options type. extension BuildToolOptions: XcodeprojOptions {} -private enum Mode: Argument, Equatable, CustomStringConvertible { +fileprivate enum Mode: Argument, Equatable, CustomStringConvertible { case build(Configuration, Toolchain) case clean(CleanMode) case usage @@ -60,7 +60,7 @@ private enum Mode: Argument, Equatable, CustomStringConvertible { } } -private enum BuildToolFlag: Argument { +fileprivate enum BuildToolFlag: Argument { case xcc(String) case xld(String) case xswiftc(String) @@ -110,7 +110,7 @@ private enum BuildToolFlag: Argument { } } -private class BuildToolOptions: Options { +fileprivate class BuildToolOptions: Options { var verbosity: Int = 0 var Xcc: [String] = [] var Xld: [String] = [] @@ -278,7 +278,7 @@ public struct SwiftBuildTool { } extension Build.Configuration { - private init(_ rawValue: String?) throws { + fileprivate init(_ rawValue: String?) throws { switch rawValue?.lowercased() { case "debug"?: self = .debug @@ -295,7 +295,7 @@ extension Build.Configuration { enum CleanMode: CustomStringConvertible { case build, dist - private init(_ rawValue: String?) throws { + fileprivate init(_ rawValue: String?) throws { switch rawValue?.lowercased() { case nil, "build"?: self = .build diff --git a/Sources/Commands/SwiftPackageTool.swift b/Sources/Commands/SwiftPackageTool.swift index 837aaf3679d..0347696dea1 100644 --- a/Sources/Commands/SwiftPackageTool.swift +++ b/Sources/Commands/SwiftPackageTool.swift @@ -29,7 +29,7 @@ import func POSIX.chdir /// Additional conformance for our Options type. extension PackageToolOptions: XcodeprojOptions {} -private enum Mode: Argument, Equatable, CustomStringConvertible { +fileprivate enum Mode: Argument, Equatable, CustomStringConvertible { case doctor case dumpPackage case fetch @@ -80,7 +80,7 @@ private enum Mode: Argument, Equatable, CustomStringConvertible { } } -private enum PackageToolFlag: Argument { +fileprivate enum PackageToolFlag: Argument { case initMode(String) case showDepsMode(String) case inputPath(String) @@ -136,7 +136,7 @@ private enum PackageToolFlag: Argument { } } -private class PackageToolOptions: Options { +fileprivate class PackageToolOptions: Options { var initMode: InitMode = InitMode.library var showDepsMode: ShowDependenciesMode = ShowDependenciesMode.text var inputPath: String? = nil diff --git a/Sources/Commands/SwiftTestTool.swift b/Sources/Commands/SwiftTestTool.swift index 16a382e2f4e..ec2fc4baec5 100644 --- a/Sources/Commands/SwiftTestTool.swift +++ b/Sources/Commands/SwiftTestTool.swift @@ -16,7 +16,7 @@ import Utility import func POSIX.chdir import func POSIX.exit -private enum TestError: ErrorProtocol { +fileprivate enum TestError: ErrorProtocol { case testsExecutableNotFound } @@ -29,7 +29,7 @@ extension TestError: CustomStringConvertible { } } -private enum Mode: Argument, Equatable, CustomStringConvertible { +fileprivate enum Mode: Argument, Equatable, CustomStringConvertible { case usage case run(String?) @@ -59,7 +59,7 @@ private func ==(lhs: Mode, rhs: Mode) -> Bool { return lhs.description == rhs.description } -private enum TestToolFlag: Argument { +fileprivate enum TestToolFlag: Argument { case chdir(String) init?(argument: String, pop: () -> String?) throws { @@ -200,7 +200,7 @@ public struct SwiftTestTool { } } -private extension String { +fileprivate extension String { var isValidTest: Bool { #if os(OSX) return isDirectory // ${foo}.xctest is dir on OSX diff --git a/Sources/Commands/init.swift b/Sources/Commands/init.swift index 92f0534dca5..57c29ff403a 100644 --- a/Sources/Commands/init.swift +++ b/Sources/Commands/init.swift @@ -17,7 +17,7 @@ import func Utility.fputs import func Utility.makeDirectories import struct Utility.Path -private enum InitError: ErrorProtocol { +fileprivate enum InitError: ErrorProtocol { case manifestAlreadyExists } diff --git a/Sources/Commands/show-dependencies.swift b/Sources/Commands/show-dependencies.swift index 33531e68ca2..0543ae5e548 100644 --- a/Sources/Commands/show-dependencies.swift +++ b/Sources/Commands/show-dependencies.swift @@ -26,12 +26,12 @@ func dumpDependenciesOf(rootPackage: Package, mode: ShowDependenciesMode) { } -private protocol DependenciesDumper { +fileprivate protocol DependenciesDumper { func dump(dependenciesOf: Package) } -private final class PlainTextDumper: DependenciesDumper { +fileprivate final class PlainTextDumper: DependenciesDumper { func dump(dependenciesOf rootpkg: Package) { func recursiveWalk(packages: [Package], prefix: String = "") { var hanger = prefix + "├── " @@ -64,7 +64,7 @@ private final class PlainTextDumper: DependenciesDumper { } } -private final class DotDumper: DependenciesDumper { +fileprivate final class DotDumper: DependenciesDumper { func dump(dependenciesOf rootpkg: Package) { func recursiveWalk(rootpkg: Package) { printNode(rootpkg) @@ -94,7 +94,7 @@ private final class DotDumper: DependenciesDumper { } } -private final class JsonDumper: DependenciesDumper { +fileprivate final class JsonDumper: DependenciesDumper { func dump(dependenciesOf rootpkg: Package) { func recursiveWalk(rootpkg: Package, isLast: Bool = true) { diff --git a/Sources/Get/Package.swift b/Sources/Get/Package.swift index 099b4793163..79773120db5 100644 --- a/Sources/Get/Package.swift +++ b/Sources/Get/Package.swift @@ -32,7 +32,7 @@ extension Package: Fetchable { return manifest.package.dependencies.map{ ($0.url, $0.versionRange) } } - private var versionString: String.CharacterView { + fileprivate var versionString: String.CharacterView { return path.basename.characters.dropFirst(name.characters.count + 1) } diff --git a/Sources/Get/PackagesDirectory.swift b/Sources/Get/PackagesDirectory.swift index 16eeab77900..93fc073e418 100644 --- a/Sources/Get/PackagesDirectory.swift +++ b/Sources/Get/PackagesDirectory.swift @@ -28,7 +28,7 @@ class PackagesDirectory { } /// The set of all repositories available within the `Packages` directory, by origin. - private lazy var availableRepositories: [String: Git.Repo] = { [unowned self] in + fileprivate lazy var availableRepositories: [String: Git.Repo] = { [unowned self] in var result = Dictionary() for prefix in walk(self.prefix, recursively: false) { guard let repo = Git.Repo(path: prefix), origin = repo.origin else { continue } // TODO: Warn user. diff --git a/Sources/PackageLoading/Manifest+parse.swift b/Sources/PackageLoading/Manifest+parse.swift index 363fab11c98..6436fb9bd0f 100644 --- a/Sources/PackageLoading/Manifest+parse.swift +++ b/Sources/PackageLoading/Manifest+parse.swift @@ -187,7 +187,7 @@ extension PackageDescription.Package.Dependency { } extension PackageDescription.SystemPackageProvider { - private static func fromTOML(_ item: TOMLItem) -> PackageDescription.SystemPackageProvider { + fileprivate static func fromTOML(_ item: TOMLItem) -> PackageDescription.SystemPackageProvider { guard case .table(let table) = item else { fatalError("unexpected item") } guard case .string(let name)? = table.items["name"] else { fatalError("missing name") } guard case .string(let value)? = table.items["value"] else { fatalError("missing value") } @@ -203,7 +203,7 @@ extension PackageDescription.SystemPackageProvider { } extension PackageDescription.Target { - private static func fromTOML(_ item: TOMLItem) -> PackageDescription.Target { + fileprivate static func fromTOML(_ item: TOMLItem) -> PackageDescription.Target { // This is a private API, currently, so we do not currently try and // validate the input. guard case .table(let table) = item else { fatalError("unexpected item") } @@ -223,7 +223,7 @@ extension PackageDescription.Target { } extension PackageDescription.Target.Dependency { - private static func fromTOML(_ item: TOMLItem) -> PackageDescription.Target.Dependency { + fileprivate static func fromTOML(_ item: TOMLItem) -> PackageDescription.Target.Dependency { guard case .string(let name) = item else { fatalError("unexpected item") } return .Target(name: name) } diff --git a/Sources/PackageLoading/Module+PkgConfig.swift b/Sources/PackageLoading/Module+PkgConfig.swift index e6af484e87a..903f195dd28 100644 --- a/Sources/PackageLoading/Module+PkgConfig.swift +++ b/Sources/PackageLoading/Module+PkgConfig.swift @@ -53,8 +53,8 @@ extension ModuleProtocol { } } -private extension SystemPackageProvider { - private var installText: String { +fileprivate extension SystemPackageProvider { + fileprivate var installText: String { switch self { case .Brew(let name): return " brew install \(name)\n" diff --git a/Sources/PackageLoading/ModuleMapGeneration.swift b/Sources/PackageLoading/ModuleMapGeneration.swift index 70c6364f33a..c79661cd464 100644 --- a/Sources/PackageLoading/ModuleMapGeneration.swift +++ b/Sources/PackageLoading/ModuleMapGeneration.swift @@ -117,7 +117,7 @@ extension ClangModule { } } - private enum UmbrellaType { + fileprivate enum UmbrellaType { case header(String) case directory(String) } diff --git a/Sources/PackageLoading/PackageExtensions.swift b/Sources/PackageLoading/PackageExtensions.swift index d192c87266c..c1648dd195a 100644 --- a/Sources/PackageLoading/PackageExtensions.swift +++ b/Sources/PackageLoading/PackageExtensions.swift @@ -169,11 +169,11 @@ extension Package { return try SwiftModule(name: name, sources: Sources(paths: swiftSources, root: path)) } - private func isValidSource(_ path: String) -> Bool { + fileprivate func isValidSource(_ path: String) -> Bool { return isValidSource(path, validExtensions: Sources.validExtensions) } - private func isValidSource(_ path: String, validExtensions: Set) -> Bool { + fileprivate func isValidSource(_ path: String, validExtensions: Set) -> Bool { if path.basename.hasPrefix(".") { return false } let path = path.normpath if path == manifest.path.normpath { return false } diff --git a/Sources/PackageLoading/transmute.swift b/Sources/PackageLoading/transmute.swift index f2c364ca908..0389ce79919 100644 --- a/Sources/PackageLoading/transmute.swift +++ b/Sources/PackageLoading/transmute.swift @@ -105,7 +105,7 @@ private func fillModuleGraph(_ packages: [Package], modulesForPackage: (Package) } extension Package { - private var recursiveDependencies: [Package] { + fileprivate var recursiveDependencies: [Package] { // FIXME: Refactor this to a common algorithm. var set = Set() var stack = dependencies diff --git a/Sources/SourceControl/CheckoutManager.swift b/Sources/SourceControl/CheckoutManager.swift index 59a6c878f69..d28299b2e4b 100644 --- a/Sources/SourceControl/CheckoutManager.swift +++ b/Sources/SourceControl/CheckoutManager.swift @@ -37,19 +37,19 @@ public class CheckoutManager { /// /// This is intentionally hidden from the clients so that the manager is /// allowed to move repositories transparently. - private let subpath: String + fileprivate let subpath: String /// The status of the repository. - private var status: Status = .uninitialized + fileprivate var status: Status = .uninitialized /// Create a handle. - private init(manager: CheckoutManager, subpath: String) { + fileprivate init(manager: CheckoutManager, subpath: String) { self.manager = manager self.subpath = subpath } /// Create a handle from JSON data. - private init?(manager: CheckoutManager, json data: JSON) { + fileprivate init?(manager: CheckoutManager, json data: JSON) { guard case let .dictionary(contents) = data, case let .string(subpath)? = contents["subpath"], case let .string(statusString)? = contents["status"], @@ -88,7 +88,7 @@ public class CheckoutManager { // MARK: Persistence - private func toJSON() -> JSON { + fileprivate func toJSON() -> JSON { return .dictionary([ "status": .string(status.rawValue), "subpath": .string(subpath) @@ -168,7 +168,7 @@ public class CheckoutManager { // MARK: Persistence - private enum PersistenceError: ErrorProtocol { + fileprivate enum PersistenceError: ErrorProtocol { /// The schema does not match the current version. case invalidVersion diff --git a/Sources/SourceControl/GitRepository.swift b/Sources/SourceControl/GitRepository.swift index 224c9c73770..46ed0ace8a7 100644 --- a/Sources/SourceControl/GitRepository.swift +++ b/Sources/SourceControl/GitRepository.swift @@ -67,7 +67,7 @@ public class GitRepositoryProvider: RepositoryProvider { } /// A basic `git` repository. -private class GitRepository: Repository { +fileprivate class GitRepository: Repository { /// The path of the repository on disk. let path: String diff --git a/Sources/Utility/Path.swift b/Sources/Utility/Path.swift index ef604c80771..e97fbe9134c 100644 --- a/Sources/Utility/Path.swift +++ b/Sources/Utility/Path.swift @@ -278,7 +278,7 @@ extension String { } /// - Returns: Ensures single path separators in a path string, and removes trailing slashes. - private var onesep: String { + fileprivate var onesep: String { // Fast path, for already clean strings. // // It would be more efficient to avoid scrubbing every string that diff --git a/Sources/Utility/walk.swift b/Sources/Utility/walk.swift index 07b88182644..dd8bbbad75f 100644 --- a/Sources/Utility/walk.swift +++ b/Sources/Utility/walk.swift @@ -60,11 +60,11 @@ public func walk(_ paths: String..., recursing: (String) -> Bool) -> RecursibleD /** A generator for a single directory’s contents */ -private class DirectoryContentsGenerator: IteratorProtocol { +fileprivate class DirectoryContentsGenerator: IteratorProtocol { private let dirptr: DirHandle? - private let path: String + fileprivate let path: String - private init(path: String) { + fileprivate init(path: String) { let path = path.normpath dirptr = libc.opendir(path) self.path = path @@ -103,7 +103,7 @@ public class RecursibleDirectoryContentsGenerator: IteratorProtocol, Sequence { private var towalk = [String]() private let shouldRecurse: (String) -> Bool - private init(path: String, recursionFilter: (String) -> Bool) { + fileprivate init(path: String, recursionFilter: (String) -> Bool) { current = DirectoryContentsGenerator(path: path) shouldRecurse = recursionFilter } diff --git a/Tests/Get/VersionGraphTests.swift b/Tests/Get/VersionGraphTests.swift index 8a275aca58a..c7a6a94177d 100644 --- a/Tests/Get/VersionGraphTests.swift +++ b/Tests/Get/VersionGraphTests.swift @@ -327,7 +327,7 @@ private let v123 = Version(1,2,3) private let v126 = Version(1,2,6) private let v199 = Version(1,9,9) -private enum MockProject: String { +fileprivate enum MockProject: String { case A case B case C @@ -337,7 +337,7 @@ private enum MockProject: String { var url: String { return rawValue } } -private class MockCheckout: Equatable, CustomStringConvertible, Fetchable { +fileprivate class MockCheckout: Equatable, CustomStringConvertible, Fetchable { let project: MockProject let children: [(String, Range)] var availableVersions: [Version] @@ -375,7 +375,7 @@ private func ==(lhs: MockCheckout, rhs: MockCheckout) -> Bool { return lhs.project == rhs.project && lhs.version == rhs.version } -private class _MockFetcher: Fetcher { +fileprivate class _MockFetcher: Fetcher { private typealias T = MockCheckout func find(url: String) throws -> Fetchable? { diff --git a/Tests/PackageLoading/ModuleDependencyTests.swift b/Tests/PackageLoading/ModuleDependencyTests.swift index bb476e01e2f..cd02b54e16f 100644 --- a/Tests/PackageLoading/ModuleDependencyTests.swift +++ b/Tests/PackageLoading/ModuleDependencyTests.swift @@ -169,12 +169,12 @@ class ModuleDependencyTests: XCTestCase { ] } -private extension Module { - private func depends(on target: Module) { +fileprivate extension Module { + fileprivate func depends(on target: Module) { dependencies.append(target) } - private var recursiveDeps: [Module] { + fileprivate var recursiveDeps: [Module] { sort(self) return dependencies } diff --git a/Tests/SourceControl/CheckoutManagerTests.swift b/Tests/SourceControl/CheckoutManagerTests.swift index a32c8dec0d1..dc737a0ce6e 100644 --- a/Tests/SourceControl/CheckoutManagerTests.swift +++ b/Tests/SourceControl/CheckoutManagerTests.swift @@ -14,11 +14,11 @@ import SourceControl import func POSIX.mkdtemp -private enum DummyError: ErrorProtocol { +fileprivate enum DummyError: ErrorProtocol { case invalidRepository } -private class DummyRepositoryProvider: RepositoryProvider { +fileprivate class DummyRepositoryProvider: RepositoryProvider { var numFetches = 0 func fetch(repository: RepositorySpecifier, to path: String) throws {