@@ -60,7 +60,7 @@ index c18e2c8e..65872fb9 100644
60
60
let temporaryDirectory = try await FileSystem.shared.temporaryDirectory
61
61
@@ -1013,7 +1012,7 @@ final class FileHandleTests: XCTestCase {
62
62
try await handle.close()
63
- let info = try await FileSystem.shared.info(forFileAt: path)
63
+ let info = try await FileSystem.shared.info(forFileAt: NIOFilePath( path) )
64
64
XCTAssertNotNil(info)
65
65
- }
66
66
+ }*/
@@ -71,23 +71,24 @@ diff --git a/Tests/NIOFileSystemIntegrationTests/FileSystemTests.swift b/Tests/N
71
71
index f24736a7..310d9691 100644
72
72
--- a/Tests/NIOFileSystemIntegrationTests/FileSystemTests.swift
73
73
+++ b/Tests/NIOFileSystemIntegrationTests/FileSystemTests.swift
74
- @@ -19,8 +19,8 @@ import NIOCore
75
- @_spi(Testing) @testable import _NIOFileSystem
76
-
77
- extension FilePath {
78
- - static let testData = FilePath(#filePath)
79
- - .removingLastComponent() // FileHandleTests.swift
80
- + static let testFile = FilePath("/data/data/com.termux/pack/FileHandleTests.swift")
81
- + static let testData = FilePath("/data/data/com.termux/pack/")
82
- .appending("Test Data")
83
- .lexicallyNormalized()
74
+ @@ -19,9 +19,8 @@ import NIOCore
75
+ import XCTest
84
76
77
+ extension NIOFilePath {
78
+ - static let testData = NIOFilePath(
79
+ - FilePath(#filePath)
80
+ - .removingLastComponent() // FileHandleTests.swift
81
+ + static let testFile = NIOFilePath("/data/data/com.termux/pack/FileHandleTests.swift")
82
+ + static let testData = NIOFilePath(FilePath("/data/data/com.termux/pack/")
83
+ .appending("Test Data")
84
+ .lexicallyNormalized()
85
+ )
85
86
@@ -100,7 +100,7 @@ final class FileSystemTests: XCTestCase {
86
87
}
87
88
88
89
func testOpenFileWhereIntermediateIsNotADirectory() async throws {
89
- - let path = FilePath(#filePath).appending("foobar")
90
- + let path = FilePath.testFile.appending("foobar")
90
+ - let path = NIOFilePath( FilePath(#filePath).appending("foobar") )
91
+ + let path = NIOFilePath( FilePath(NIOFilePath .testFile) .appending("foobar") )
91
92
92
93
// For reading:
93
94
await XCTAssertThrowsFileSystemErrorAsync {
@@ -99,7 +100,7 @@ index f24736a7..310d9691 100644
99
100
+ /*func testOpenNonExistentFileForWritingWithMaterialization() async throws {
100
101
for isAbsolute in [true, false] {
101
102
let path = try await self.fs.temporaryFilePath(inTemporaryDirectory: isAbsolute)
102
- XCTAssertEqual(path.isAbsolute, isAbsolute)
103
+ XCTAssertEqual(path.underlying. isAbsolute, isAbsolute)
103
104
@@ -256,7 +256,7 @@ final class FileSystemTests: XCTestCase {
104
105
XCTAssertEqual(buffer.readBytes(length: 1024), Array(repeating: 0, count: 1024))
105
106
XCTAssertEqual(buffer.readBytes(length: 1024), Array(repeating: 1, count: 1024))
@@ -149,53 +150,53 @@ index f24736a7..310d9691 100644
149
150
}
150
151
151
152
func testReadChunksRange() async throws {
152
- - try await self.fs.withFileHandle(forReadingAt: FilePath (#filePath)) { handle in
153
- + try await self.fs.withFileHandle(forReadingAt: FilePath .testFile) { handle in
153
+ - try await self.fs.withFileHandle(forReadingAt: NIOFilePath (#filePath)) { handle in
154
+ + try await self.fs.withFileHandle(forReadingAt: NIOFilePath .testFile) { handle in
154
155
let info = try await handle.info()
155
156
let size = info.size
156
157
let endIndex = size + 1
157
158
@@ -1310,7 +1310,7 @@ extension FileSystemTests {
158
159
}
159
160
160
161
func testReadChunksClosedRange() async throws {
161
- - try await self.fs.withFileHandle(forReadingAt: FilePath (#filePath)) { handle in
162
- + try await self.fs.withFileHandle(forReadingAt: FilePath .testFile) { handle in
162
+ - try await self.fs.withFileHandle(forReadingAt: NIOFilePath (#filePath)) { handle in
163
+ + try await self.fs.withFileHandle(forReadingAt: NIOFilePath .testFile) { handle in
163
164
let info = try await handle.info()
164
165
let size = info.size
165
166
let endIndex = size + 1
166
167
@@ -1337,7 +1337,7 @@ extension FileSystemTests {
167
168
}
168
169
169
170
func testReadChunksPartialRangeUpTo() async throws {
170
- - try await self.fs.withFileHandle(forReadingAt: FilePath (#filePath)) { handle in
171
- + try await self.fs.withFileHandle(forReadingAt: FilePath .testFile) { handle in
171
+ - try await self.fs.withFileHandle(forReadingAt: NIOFilePath (#filePath)) { handle in
172
+ + try await self.fs.withFileHandle(forReadingAt: NIOFilePath .testFile) { handle in
172
173
let info = try await handle.info()
173
174
let size = info.size
174
175
let endIndex = size + 1
175
176
@@ -1365,7 +1365,7 @@ extension FileSystemTests {
176
177
}
177
178
178
179
func testReadChunksPartialRangeThrough() async throws {
179
- - try await self.fs.withFileHandle(forReadingAt: FilePath (#filePath)) { handle in
180
- + try await self.fs.withFileHandle(forReadingAt: FilePath .testFile) { handle in
180
+ - try await self.fs.withFileHandle(forReadingAt: NIOFilePath (#filePath)) { handle in
181
+ + try await self.fs.withFileHandle(forReadingAt: NIOFilePath .testFile) { handle in
181
182
let info = try await handle.info()
182
183
let size = info.size
183
184
let endIndex = size + 1
184
185
@@ -1394,7 +1394,7 @@ extension FileSystemTests {
185
186
}
186
187
187
188
func testReadChunksPartialRangeFrom() async throws {
188
- - try await self.fs.withFileHandle(forReadingAt: FilePath (#filePath)) { handle in
189
- + try await self.fs.withFileHandle(forReadingAt: FilePath .testFile) { handle in
189
+ - try await self.fs.withFileHandle(forReadingAt: NIOFilePath (#filePath)) { handle in
190
+ + try await self.fs.withFileHandle(forReadingAt: NIOFilePath .testFile) { handle in
190
191
let info = try await handle.info()
191
192
let size = info.size
192
193
let endIndex = size + 1
193
194
@@ -1418,7 +1418,7 @@ extension FileSystemTests {
194
195
}
195
196
196
197
func testReadChunksUnboundedRange() async throws {
197
- - try await self.fs.withFileHandle(forReadingAt: FilePath (#filePath)) { handle in
198
- + try await self.fs.withFileHandle(forReadingAt: FilePath .testFile) { handle in
198
+ - try await self.fs.withFileHandle(forReadingAt: NIOFilePath (#filePath)) { handle in
199
+ + try await self.fs.withFileHandle(forReadingAt: NIOFilePath .testFile) { handle in
199
200
let info = try await handle.info()
200
201
let size = info.size
201
202
@@ -204,8 +205,8 @@ index 66ed1171..5253a650 100644
204
205
--- a/Tests/NIOFileSystemTests/Internal/SyscallTests.swift
205
206
+++ b/Tests/NIOFileSystemTests/Internal/SyscallTests.swift
206
207
@@ -17,6 +17,10 @@
208
+ import SystemPackage
207
209
import XCTest
208
- @_spi(Testing) import _NIOFileSystem
209
210
210
211
+ #if canImport(Android)
211
212
+ import Android
0 commit comments