Skip to content

Commit 164fe8c

Browse files
authored
Merge pull request #136 from compnerd/singularity
Tests: avoid unnecessary duplication (NFCI)
2 parents 022a7fe + e1ab868 commit 164fe8c

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

Tests/SystemTests/FilePathTests/FilePathTest.swift

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,7 @@ import System
1616
#endif
1717

1818
@available(/*System 0.0.1: macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0*/iOS 8, *)
19-
func filePathFromInvalidCodePointSequence<S: Sequence>(_ bytes: S) -> FilePath where S.Element == UTF16.CodeUnit {
20-
var array = Array(bytes)
21-
assert(array.last != 0, "already null terminated")
22-
array += [0]
23-
24-
return array.withUnsafeBufferPointer {
25-
$0.withMemoryRebound(to: CInterop.PlatformChar.self) {
26-
FilePath(platformString: $0.baseAddress!)
27-
}
28-
}
29-
}
30-
31-
@available(/*System 0.0.1: macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0*/iOS 8, *)
32-
func filePathFromInvalidCodePointSequence<S: Sequence>(_ bytes: S) -> FilePath where S.Element == UTF8.CodeUnit {
19+
func filePathFromInvalidCodePointSequence<S: Sequence>(_ bytes: S) -> FilePath where S.Element == CInterop.PlatformUnicodeEncoding.CodeUnit {
3320
var array = Array(bytes)
3421
assert(array.last != 0, "already null terminated")
3522
array += [0]

0 commit comments

Comments
 (0)