No fatal on linux Swift < 5
This commit is contained in:
@@ -130,7 +130,11 @@ public extension Path.Finder {
|
|||||||
while let path = next() {
|
while let path = next() {
|
||||||
switch try closure(path) {
|
switch try closure(path) {
|
||||||
case .skip:
|
case .skip:
|
||||||
|
#if !os(Linux) || swift(>=5.0)
|
||||||
enumerator.skipDescendants()
|
enumerator.skipDescendants()
|
||||||
|
#else
|
||||||
|
fputs("warning: skip is not implemented for Swift < 5.0\n", stderr)
|
||||||
|
#endif
|
||||||
case .abort:
|
case .abort:
|
||||||
return
|
return
|
||||||
case .continue:
|
case .continue:
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ extension PathTests {
|
|||||||
try tmpdir.b.mkdir().join("c").touch()
|
try tmpdir.b.mkdir().join("c").touch()
|
||||||
try tmpdir.b.d.mkdir().join("e").touch()
|
try tmpdir.b.d.mkdir().join("e").touch()
|
||||||
try tmpdir.b.d.f.mkdir().join("g").touch()
|
try tmpdir.b.d.f.mkdir().join("g").touch()
|
||||||
|
#if !os(Linux) || swift(>=5)
|
||||||
do {
|
do {
|
||||||
var rv = Set<Path>()
|
var rv = Set<Path>()
|
||||||
|
|
||||||
@@ -184,6 +184,7 @@ extension PathTests {
|
|||||||
|
|
||||||
XCTAssertEqual(rv, Set([tmpdir.a, tmpdir.b, tmpdir.b.c].map(Path.init)))
|
XCTAssertEqual(rv, Set([tmpdir.a, tmpdir.b, tmpdir.b.c].map(Path.init)))
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
do {
|
do {
|
||||||
var x = 0
|
var x = 0
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user