CodeCoverage++

This commit is contained in:
Max Howell
2020-01-25 12:06:11 -05:00
parent 0de9715b46
commit 260196a27a
5 changed files with 187 additions and 13 deletions

View File

@@ -14,7 +14,13 @@ public extension Path {
private let enumerator: FileManager.DirectoryEnumerator!
/// The range of directory depths for which the find operation will return entries.
private(set) public var depth: ClosedRange<Int> = 1...Int.max
private(set) public var depth: ClosedRange<Int> = 1...Int.max {
didSet {
if depth.lowerBound < 0 {
depth = 0...depth.upperBound
}
}
}
/// The kinds of filesystem entries find operations will return.
public var types: Set<EntryType> {
@@ -42,11 +48,7 @@ extension Path.Finder: Sequence, IteratorProtocol {
continue
}
if enumerator.level < depth.lowerBound {
if path == self.path, depth.lowerBound == 0 {
return path
} else {
continue
}
continue
}
#endif