Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -256,15 +256,17 @@ let package = Package(
dependencies: [
"_NIOFileSystem"
],
path: "Sources/_NIOFileSystemExported"
path: "Sources/_NIOFileSystemExported",
swiftSettings: strictConcurrencySettings
),
.target(
name: "_NIOFileSystemFoundationCompat",
dependencies: [
"_NIOFileSystem",
"NIOFoundationCompat",
],
path: "Sources/NIOFileSystemFoundationCompat"
path: "Sources/NIOFileSystemFoundationCompat",
swiftSettings: strictConcurrencySettings
),

// MARK: - Examples
Expand Down Expand Up @@ -543,7 +545,7 @@ let package = Package(
swiftCollections,
swiftSystem,
],
swiftSettings: [
swiftSettings: strictConcurrencySettings + [
.define("ENABLE_MOCKING", .when(configuration: .debug))
]
),
Expand All @@ -560,14 +562,16 @@ let package = Package(
// for the integration tests. Exclude the whole tree from
// the build.
"Test Data"
]
],
swiftSettings: strictConcurrencySettings
),
.testTarget(
name: "NIOFileSystemFoundationCompatTests",
dependencies: [
"_NIOFileSystem",
"_NIOFileSystemFoundationCompat",
]
],
swiftSettings: strictConcurrencySettings
),
]
)
Expand Down
12 changes: 6 additions & 6 deletions Tests/NIOFileSystemIntegrationTests/FileSystemTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -585,9 +585,9 @@ final class FileSystemTests: XCTestCase {
func testCopyLargeFile() async throws {
let sourcePath = try await self.fs.temporaryFilePath()
let destPath = try await self.fs.temporaryFilePath()
self.addTeardownBlock {
_ = try? await self.fs.removeItem(at: sourcePath, strategy: .platformDefault)
_ = try? await self.fs.removeItem(at: destPath, strategy: .platformDefault)
self.addTeardownBlock { [fs] in
_ = try? await fs.removeItem(at: sourcePath, strategy: .platformDefault)
_ = try? await fs.removeItem(at: destPath, strategy: .platformDefault)
}

let sourceInfo = try await self.fs.withFileHandle(
Expand Down Expand Up @@ -854,7 +854,7 @@ final class FileSystemTests: XCTestCase {
_ copyStrategy: CopyStrategy,
_ description: String,
_ path: FilePath,
triggerCancel: @escaping (DirectoryEntry) -> Bool,
triggerCancel: @escaping @Sendable (DirectoryEntry) -> Bool,
line: UInt = #line
) async throws {

Expand All @@ -863,8 +863,8 @@ final class FileSystemTests: XCTestCase {
let requestedCancel = NIOLockedValueBox<Bool>(false)
let cancelRequested = expectation(description: "cancel requested")

let task = Task {
try await self.fs.copyItem(at: path, to: copyPath, strategy: copyStrategy) { _, error in
let task = Task { [fs] in
try await fs.copyItem(at: path, to: copyPath, strategy: copyStrategy) { _, error in
throw error
} shouldCopyItem: { source, destination in
// Abuse shouldCopy to trigger the cancellation after getting some way in.
Expand Down
Loading