Fix Linux testEnumerationSkippingHiddenFiles()

This commit is contained in:
Max Howell
2019-01-20 17:32:37 -05:00
parent 751b855a26
commit 920f007660
3 changed files with 18 additions and 11 deletions

View File

@@ -31,8 +31,9 @@ class PathTests: XCTestCase {
XCTAssertEqual(paths, ["a", "b", "c", ".d"])
}
func testEnumerationSkippingHiddenFiles() throws {
#if !os(Linux)
let tmpdir_ = try TemporaryDirectory()
let tmpdir = tmpdir_.path
try tmpdir.join("a").mkdir().join("c").touch()
@@ -42,7 +43,7 @@ class PathTests: XCTestCase {
var paths = Set<String>()
var dirs = 0
for entry in try tmpdir.ls(skipHiddenFiles: true) {
for entry in try tmpdir.ls(includeHiddenFiles: false) {
if entry.kind == .directory {
dirs += 1
}
@@ -50,7 +51,7 @@ class PathTests: XCTestCase {
}
XCTAssertEqual(dirs, 1)
XCTAssertEqual(paths, ["a", "b", "c"])
#endif
}
func testRelativeTo() {

View File

@@ -17,7 +17,7 @@ extension PathTests {
]
}
#if os(Linux)
#if !os(macOS)
public func __allTests() -> [XCTestCaseEntry] {
return [
testCase(PathTests.__allTests),